Mayor R. Scott Silverthorne, 50, a third-term mayor, was arrested Thursday after he met the undercover detectives at a Crown Plaza Hotel in Fairfax, according to authorities. He approached the detectives through a website for casual sex between men, said police.

The city appointed Councilman Jeffrey C. Greenfield as acting mayor, effective immediately.

At a city council meeting, Police Capt. Jack Hardin of the Fairfax Police Department said, “We were provided info from a citizen where the mayor was possibly involved -- sort of like a dating website where he meets other men and distributing meth for sex.”

Detectives busted Silverthorne, who's also a substitute teacher, through the online setup. “We had an idea of what the mayor was looking for, the types of activities,” he said.

Two other men from Maryland- the alleged drug suppliers - were taken into custody.

In a statement, acting Mayor Jeffrey C. Greenfield said, “Pursuant to city charter, the mayor has appointed me acting mayor, until further notice.”

“The city of Fairfax city council appreciates Mr. Silverthorne’s longstanding dedication to the community. He has served the city of Fairfax as a councilmember and mayor for more than a quarter of a century. The community has benefitted from his dedication and his vision for making Fairfax an excellent place to live and work,” he said.

In January, Silverthorne told The Washington Post, “it’s been a terrible year for me” in reference to financial and medical problems.

In June 2015, he was laid off from his job at the National Association of Manufacturers, and reportedly owed $58,000 to creditors. He filed for federal bankruptcy protection, and a bank foreclosed on his home, according to The Washington Post.

“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.”