FAIRFAX, Va. -- A three-term northern Virginia mayor will resign after being arrested on drug charges, reports CBS affiliate WUSA-TV in Washington, D.C.

City of Fairfax Mayor R. Scott Silverthorne allegedly tried to trade two grams of methamphetamine for sex acts in what turned out to be an undercover sting operation, police said last week.

Silverthorne plans to resign Thursday, WUSA reports. His attorneys say he is not a drug dealer.

Get Breaking News Delivered to Your Inbox

The mayor was arrested Thursday night after meeting at a Tysons Corner hotel just outside the Capital Beltway with undercover detectives he approached through a website used to arrange casual sexual encounters between men, Fairfax County police said at a press conference.

Police Capt. Jack Hardin said they received a tip that Silverthorne had been arranging drugs-for-sex encounters. Police then set up an online profile on the website, and within two days Silverthorne made contact online with the detective who set up the profile, Hardin said.

"We had information on what the mayor was looking for, what types of activities" he wanted to engage in, Hardin said.

Silverthorne, who also worked as a substitute teacher in Fairfax County Public Schools, was arrested and gave a full confession, police said. He was released on his own recognizance while he awaits a preliminary hearing Oct. 31 on a felony charge of drug distribution and a misdemeanor charge of possessing drug paraphernalia.

Silverthorne, in an email to The Associated Press, declined comment and referred questions to his attorney, Brian Drummond, who did not immediately return a phone call Friday morning.

The city announced Friday that Silverthorne appointed Councilman Jeffrey Greenfield as acting mayor, effective immediately. The city charter gives the mayor the power to appoint an acting mayor in his place in the event of a mayor's absence or disability.

Greenfield issued a statement saying he would serve as 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 benefited from his dedication and his vision," Greenfield said.

Hardin didn't know how long Silverthorne had been using the website, which he did not identify. But he said drugs-for-sex encounters were common on the website, and that Silverthorne has set up a similar encounter at least once before.

In the sting operation, the undercover detectives agreed to meet for a group sexual encounter in exchange for methamphetamine, police said. Silverthorne, 50, would provide methamphetamine and the undercover detectives would provide the hotel room, Hardin said.

After detectives met Silverthorne at the Crowne Plaza Hotel in McLean on Thursday night, they saw him meet suppliers, Hardin said. Silverthorne was arrested after police said he gave detectives methamphetamine.

One person who was with the mayor was arrested and another person was released, Hardin said.

Detectives were able to find and arrest the suppliers, who were still in the area, he said. Detectives charged Juan Jose Fernandez, 34, of Takoma Park, Maryland, with distribution of methamphetamine, possession with the intent to distribute methamphetamine and possession of drug paraphernalia.

Caustin Lee McLaughlin, 21, also of Takoma Park, was charged with distribution of methamphetamine, obstruction of justice and possession of drug paraphernalia. As detectives arrested McLaughlin, police said he resisted and a detective used his stun gun. Police said there were no injuries.

Calls to the Office of the Public Defender, which is representing Fernandez, were not returned. No attorney was listed for McLaughlin on online court records.

Prior to serving as mayor, Silverthorne, a Democrat, also served nine terms on the Fairfax City Council from 1990 through 2008.

His father, the late Frederick Silverthorne, was mayor of Fairfax in the late 1970s and early 1980s.

Despite Silverthorne's long years of service, he was not an especially prominent public figure in the greater D.C. region, where local politics often take a backseat to federal politics.

Silverthorne was re-elected in May for a third term of the city of 24,000, about 20 miles west of the nation's capital, after a tumultuous year in which he filed for bankruptcy, lost his home to foreclosure and was diagnosed with cancer. He announced in November that he'd been diagnosed with squamous cell carcinoma.

Silverthorne defeated Tom Ammazzalorso in May with 58 percent of the vote. Ammazzalorso, a high school history teacher, raised questions about Silverthorne's fitness to serve as mayor given his personal financial problems.

Ammazzalorso said in a phone interview Friday that he knew Silverthorne had personal and professional problems "but never in a million years would I have imagined this."

"My heart goes out to his entire family, he said. "He loves Fairfax City."

Fairfax County Public Schools spokesman John Torre says Silverthorne was hired as a substitute teacher in April and terminated Friday because of this arrest. Silverthorne was used as a substitute between April and the end of the school year, he said.