Scott Silverthorne built a reputation as a civic pillar of Fairfax City, Va., over three decades, helping bring a park to the affluent suburb’s downtown and championing other improvements during his stints as a City Council member and mayor.

But even as he was the public face of the city, police said, Silverthorne was privately leading another life online: using a website to swap methamphetamine for sex with other men.

That other side of Silverthorne, 50, burst into public view Friday, as Fairfax County police announced that he had been charged following a sting in which they said he agreed to give an undercover officer the drug in exchange for an orgy at a Tysons hotel.

The arrest marked a stunning downfall for Silverthorne, who had followed his father into the mayor’s office, recently beaten cancer and coped with the loss of his job and house. Through text messages, Silverthorne declined to discuss the charges.

Fairfax City Mayor Scott Silverthorne watches video of a city council meeting in December. (Dayna Smith/for The Washington Post)

The news shocked residents and Fairfax City officials, and clouded the future of projects Silverthorne was pushing. City Council member Jeffrey C. Greenfield was appointed acting mayor of the city of 23,500 residents, which is 20 miles west of Washington.

“The city of Fairfax City Council appreciates Mr. Silverthorne’s long-standing dedication to the community,” Greenfield said in a statement read to TV cameras outside City Hall. “The community has benefitted from his dedication and his vision.”

One former political opponent showed up Friday at the city registrar’s office to investigate the process of running for mayor in a special election. Others simply expressed shock at seeing a man they watched rise through local politics fall in such an unexpected way.

“The sad thing is you can spend 30 years building up your reputation and lose it in 30 minutes,” said City Council member David L. Meyer. “I think I can speak collectively that we’re concerned for the future of the city as well, but the city is greater than one person and we’re going to persevere.”

Fairfax County police said at a news conference that Silverthorne had admitted to distributing drugs. They said they began the investigation after receiving a tip in mid-July.

“We were provided with information from a citizen that the mayor was involved with a website,” said Capt. Jack Hardin, commander of the Fairfax County police organized crime unit. “It was alleged he was exchanging meth for sex.”

Detectives created a fake profile on the site, which police declined to name, in an effort to lure Silverthorne, police said. Two days later, they said, Silverthorne messaged the account, saying he could provide drugs in exchange for group sex.

Two undercover officers arranged a meeting at the Crowne Plaza Hotel in Tysons around 7 p.m. Thursday, police said. The undercover officers met Silverthorne and two acquaintances in the parking lot.

The group waited about 20 minutes for Silverthorne’s methamphetamine supplier to arrive, police said. When he did, Silverthorne allegedly acquired about two grams of meth, then returned.

Silverthorne and one acquaintance, Caustin Lee McLaughlin, 21, of Maryland, were placed under arrest, police said. As police were trying to arrest McLaughlin, he resisted and was Tasered, police said. No one was injured during the encounter.

Afterward, detectives went into the hotel and arrested Juan Jose Fernandez, 34, of Maryland, who police said had supplied the drugs to Silverthorne and was at the bar. Silverthorne’s other acquaintance was released without being charged.

Silverthorne was charged with felony distribution of methamphetamine and misdemeanor possession of drug paraphernalia. McLaughlin and Fernandez also face drug charges, and McLaughlin was charged with obstruction of justice.

All three were transported to the Fairfax County jail, where McLaughlin and Fernandez remained on Friday. The Fairfax County Public Defender’s Office, which represents Fernandez, did not return a call for comment, and court records did not list an attorney for McLaughlin.

Silverthorne was released on his own recognizance. He is scheduled to be arraigned Wednesday.

On Friday, Silverthorne, in a text message, referred requests for comment to his attorney. “Wish I could speak to you but he’s asked to direct calls to him,” Silverthorne said.

Silverthorne’s attorney, Brian Drummond, said, “Given the fact that I haven’t had the opportunity to sit down and speak with my client, I’ll have no comment at this time.”

The arrest capped a period of tumult in Silverthorne’s personal life. In January, Silverthorne told The Washington Post, “It’s been a terrible year for me,” referring to financial and medical problems.

“There’s no question about it,” he said at that time. “I can try to sugarcoat it as best I can, but the facts speak for themselves.”

In late June 2015, Silverthorne was laid off as a director of recruitment with the National Association of Manufacturers. He owed about $58,000 to various creditors and filed for federal bankruptcy protection.

A bank foreclosed on Silverthorne’s five-bedroom house, and he moved in with a friend. He was also battling neck cancer.

A Fairfax native, Silverthorne, a Democrat, was elected in May to serve his third term in the nonpartisan office of mayor. He has previously served nine terms on the City Council. And his father, the late Frederick W. Silverthorne, served as mayor of Fairfax City in the late 1970s and early 1980s.

Silverthorne worked briefly as a Fairfax County substitute teacher beginning in April, but he was terminated from that position Friday, school district officials said.

With his cancer in remission, Silverthorne recently resumed the lead in efforts among local leaders to raise Fairfax City’s economic stature by redeveloping some old strip malls and other parcels in hopes of luring in developers.

As mayor, Silverthorne has been behind some key city improvements, most notably a green-space ordinance while he served on the City Council about a decade ago that made it possible for the city to develop a downtown park.

Silverthorne was also key in easing tensions with a local center for the homeless after the city lost a Virginia Supreme Court battle four years ago that concerned an effort to push the organization out of Fairfax.

His arrest probably means that Silverthorne will step down, some local officials said. With no vice mayor, the City Council would have to schedule a special election for a new mayor, most likely in November. Silverthorne had not resigned as of Friday.

Still, John Norce, who ran for mayor against Silverthorne in 2012, wasted no time in trying to take advantage of the political disruption. “I’d be into again being involved if it helps the city,” he said after visiting the city registrar’s office to inquire about a special election.

Meanwhile, Silverthorne’s friends worried about his well-being.

“After such a rocky year financially and with his health, I had hoped that he turned a corner and was back on his feet, so this is awful,” said Fairfax County Board of Supervisors Chairman Sharon Bulova (D), who described Silverthorne as a champion for people in need of social services. “It’s just really very sad.”

Tom Ammazzalorso, Silverthorne’s challenger in the May election, said he felt sympathy for this onetime political opponent.