FAIRFAX, Va. — A former Virginia mayor has been sentenced to time served and released from jail after pleading guilty to distributing methamphetamine in a drugs-for-sex sting.

Former Fairfax Mayor R. Scott Silverthorne ended up serving about three months as a result of Friday’s sentencing in Fairfax County Circuit Court.

He had been jailed since entering a guilty plea back in March. He faced up to 40 years in prison, though a light sentence was always expected.

Silverthorne was arrested in August after a sting at a Tysons Corner hotel. Police say they received a tip Silverthorne was using a dating website to set up sexual encounters with men in exchange for drugs.

News outlets report that Silverthorne told the judge that his arrest forced him to confront his drug addiction.