A dirty cop who used his badge, service weapon and stolen NYPD raid jackets to help a gang of violent thugs rob drug dealers of $1 million cash and more than 500 pounds of cocaine faces a life sentence after pleading guilty yesterday in Brooklyn federal court.

Emmanuel Tavarez, 31, an eight-year NYPD veteran, would flash his police badge as he and his heavily armed crew stormed the hideouts of at least 100 drug dealers in New York, Philadelphia, and Bridgeport, Conn., in a spree than began at least a decade ago, prosecutors said.

“Tavarez allegedly used his police badge and falsified search warrants to stage searches and seizures of narcotics traffickers during which he and other coconspirators stole drugs and money from the traffickers,” said a statement from Brooklyn US Attorney Loretta E. Lynch.

“During one of these robberies, Tavarez restrained a victim with handcuffs. He also used his status as a police officer to obtain NYPD raid jackets and other NYPD paraphernalia and equipment for the crew so that they would appear to be authentic police officers,” Lynch said.

The crew, wearing the NYPD jackets and other gear, would learn the location of a drug dealer’s stash, stake it out and then stage a raid as if they were all police officers acting on official duty.

The gang grabbed about 250 kilograms of cocaine — more than 550 pounds — for resale, in addition to whatever cash was on hand.

Tavarez, of Deer Park, LI, was arrested in May 2010 after a lengthy investigation into the robberies by local, state and federal law-enforcement agencies.

He pleaded guilty yesterday before US Magistrate Judge Viktor V. Pohorelsky under the Hobbs Act to robbery conspiracy, conspiracy to distribute heroin and cocaine, and the use of a firearm in relation to these crimes.

The Hobbs Act was passed to combat robbery or extortion involving interstate or foreign commerce, but is also used to prosecute public corruption.

Tavarez was most recently assigned to the Housing Bureau Viper Unit in Queens.

About 15 members of the crew, which included four of the officer’s in-laws, have been charged in the robberies.