CONCORD — Joseph Cespedes was a Manchester police officer when he did favors for a known drug dealer in Massachusetts, for which he received $350 and a small amount of cocaine.

Cespedes, 37, pleaded guilty Tuesday in U.S. District Court to a charge of misprision of a felony, which U.S. Attorney John P. Kacavas said means he knew about a federal felony crime being committed and concealed it from federal authorities.

Manchester Police Chief David Mara said that Cespedes, who resigned in 2012, violated the trust not only of the people of Manchester, but also of his fellow officers.

Mara said there was no way to predict that Cespedes would become a “dirty cop.” He had undergone the intensive screening all prospective officers do, including a polygraph examination, and his background as a New York City police officer had been examined, Mara said.

“I’m happy today he is a convicted felon and I’m looking forward to his sentencing hearing,” Mara said at a news conference after Cespedes’ court hearing.

Kacavas said the Department of Homeland Security was investigating a drug dealer, an illegal alien, when it learned about Cespedes’ association with “El Fuerte” in 2011.

Cespedes, who joined the Manchester department in November 2006, was living in Lawrence, Mass., across from a barbershop named ChaCha’s. It was there that a drug dealer known as “El Fuerte” worked, authorities said.

Kacavas said Cespedes not only didn’t report the drug dealer’s activities, but also ran checks through police dispatch on the drug dealer’s behalf.

Cespedes looked to see if there were any outstanding warrants for two names the dealer was using as false identities. Cespedes used his personal cellphone for a check on Abraham Machado Lopez, telling police he was thinking of purchasing a car from the man.

Cespedes received two payments totaling $350 and a small amount of cocaine and continued to purchase small amounts of cocaine from the dealer.

The department was unaware that Cespedes was living in Lawrence, which violated departmental rules requiring officers to live within 20 miles of Manchester.

Information about Cespedes’ association with the drug dealer was passed on to Mara, who began an investigation.

Cespedes resigned in January 2012. The following month, “El Fuerte” was arrested in a raid in which 28 grams of heroin, cocaine and cash were recovered.

Cespedes applied for reinstatement to the Manchester Police Department in November 2013. That led to Cespedes — who in 2011 had been honored for helping talk a woman out of committing suicide — admitting to his involvement and the negotiations that led up to his plea Tuesday.

Kacavas said: “The Manchester Police Department did a great job in luring him back.”

Cespedes is to be sentenced Nov. 4. He faces a maximum of three years in prison, one year of supervised release and a fine up to $250,000.

Cespedes is free pending sentencing, but under federal supervision and subject to drug tests.

He was ordered to surrender his passport, but will be able to get permission from the court for specific trips to the Dominican Republic.