A Lawrence, Massachusetts, police officer was arrested late Thursday night for attempting to use his position as a member of law enforcement to extort cocaine from a drug dealer.

John Desantis Jr., 44, of Methuen, was charged in a complaint with unlawfully obtaining property by extortion by threatened force and fear. He is being detained pending a detention hearing on May 31.

According to the U.S. Attorney's Office, Desantis had been purchasing small amounts of cocaine once or twice a week for 10 to 12 months from the drug dealer without identifying himself as a police officer.

Then on May 16, during a drug transaction at his home, he displayed his gun and badge, seized the cocaine and threatened to arrest the drug dealer if he didn't continue supplying him with drugs. Desantis allegedly texted the drug dealer, saying "you will not be arrested at all if you do as I tell you to."

Lawrence Police Chief James Fitzpatrick said his department became aware of the allegations several days ago and assisted the FBI in its investigation. An internal investigation into the allegations has also been opened.

Desantis has worked for the Lawrence Police Department since 1999, but has been out on leave since February of 2015 due to a non-work-related illness, police said. The department's application to involuntary retire him has been pending with the retirement board since February, Fitzpatrick said.

"We are glad that federal law enforcement was able to apprehend this individual," Lawrence Mayor Daniel Rivera said in a statement. "While we hope that Mr. Desantis gets the help he needs, his arrest contniues to increase the credibility and professionalism of the Lawrence Police Department."

He said he hopes that the actions of this one officer will not "overshadow the stellar things that our police department does as a whole."