Richard “Scott” Silverthorne (Fairfax County Police)

After three decades of public life, Richard “Scott” Silverthorne was known simply as the mayor around Fairfax City. But online, a prosecutor said Monday, he used a sexually suggestive screen name that would lead to his stunning downfall.

Using the online moniker, Silverthorne, 50, arranged an orgy with an undercover police officer in exchange for methamphetamine on a sex site called Bare Back Real Time, the prosecutor said. Police had received a tip about Silverthorne’s activity and set up a fake account to lure him last summer.

The sting ended Silverthorne’s political career, drew national attention and, on Monday, landed him in jail, after he pleaded guilty in Fairfax County Circuit Court to one count of distributing drugs.

In a surprise move that shocked a group of supporters who had gathered in the courtroom, Circuit Judge Grace Burke Carroll remanded Silverthorne to custody until his sentencing on the charge June 9. Silverthorne had remained free on his own recognizance since his August arrest.

Some of his supporters broke down in tears after they exited the courtroom. Mary Silverthorne, his sister-in-law, said Silverthorne learned from his mistake and was rebuilding his life.

“The person I know loves Fairfax City more than anyone,” Mary Silverthorne said. “He’s not some crooked guy. He’s not what people think of when they talk about drug dealers.”

Silverthorne, who had been elected to his third term as mayor in the months before the bust, only spoke to answer a judge’s questions during the short plea hearing Monday. Wearing a gray suit, he was led away to jail.

Silverthorne faces up to 40 years in prison when he is sentenced, but because he is a first-time offender and has a long record of public service, his sentence could be months to just over a year, his attorney Brian Drummond said.

“The facts were such that it would have been futile to go to trial,” Drummond said after the hearing. “The statute for distribution in Virginia is very broad, and he is at the lower end of the spectrum. He is guilty of the transaction, but he didn’t get any money for it.”

Fairfax County Commonwealth’s Attorney Raymond F. Morrogh expressed concern for Silverthorne.

“I hope this time of sadness in Scott’s life passes quickly,” Morrogh wrote in an email.

Assistant Commonwealth’s Attorney Kathleen Bilton told the judge Monday that Silverthorne had initiated the conversation to arrange the orgy-for-drugs swap and it eventually moved from the website to text messages. Silverthorne indicated he had used methamphetamine before.

Two undercover officers met Silverthorne and two acquaintances in the parking lot of the Crowne Plaza Hotel in Tysons Corner in early August, police said. After Silverthorne obtained about two grams of meth worth about $200 from his dealer who was also on scene, police arrested all of the men.

The arrest followed a period of personal turbulence for Silverthorne, who appeared to be getting his life back on track. In January 2016, Silverthorne told The Washington Post, “It’s been a terrible year for me.”

Silverthorne was laid off as the director of recruitment at the National Association of Manufacturers in June 2015. He owed about $58,000 to creditors and filed for bankruptcy, and a bank foreclosed on his five-bedroom Fairfax home. He also was fighting neck cancer.

The Democrat had been the longtime public face of Fairfax, a small, wealthy city of about 24,000 in Fairfax County. Silverthorne helped bring a park to the city’s downtown and was pushing a variety of other projects.

Silverthorne’s father also had been mayor of Fairfax City, and the son followed him into politics. Silverthorne served nine terms on the city council before becoming mayor. He stepped down from the nonpartisan position after his arrest.

Fairfax City Council member David L. Meyer won a special election to replace Silverthorne in February. Officials are trying to recover from the cloud that Silverthorne’s arrest placed over the city.

A co-worker who attended the plea hearing Monday said Silverthorne has been working at a Bethesda hardware store in recent months. He said Silverthorne had been receiving drug counseling.

Katie Hayes, Silverthorne’s niece, said the large number of people who have attended his court hearings show his character. Many refused to abandon him, even in tough times.

“You can tell he’s a great person by the amount of support he has,” Hayes said.