Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Three retired New York City police officers and a former Brooklyn prosecutor were arrested Tuesday and charged with being part of a scheme to approve gun licenses in exchange for prostitutes, lavish meals and vacations to Mexico and the Bahamas.

John Chambers, 62, an assistant district attorney in the 1980s and now the self-styled "Top Firearms Licensing Attorney in New York," was charged in Manhattan federal court with bribery and conspiracy to commit bribery, according to federal prosecutors.

Graphic of the money for licenses scheme as presented at today's U.S. Attorney Press Conference U.S. Attorney's Office

Former NYPD officers Paul Dean and Robert Espinel were each charged with two counts of conspiracy to commit bribery and one count of extortion. And ex-NYPD officer Gaetano "Guy" Valastro was charged with two counts of conspiracy to commit bribery and one count of making false statements.

The allegedly crooked quartet was ensnared by a three-year police internal affairs and FBI investigation of the NYPD’s License Division, whose job it is to approve gun permits.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Corruption at the License Division also spawned a cottage industry of parasitic profiteers, alleged bribers masquerading as so-called expediters, that included other former police officers," Acting Manhattan U.S. Attorney Joon Kim said in a statement. "For the police officers and expediters charged in this case, the critically important police function of issuing and controlling gun licenses was one they were willing to pervert for personal profit."

Dean, 44, was a lieutenant and, as the second-highest ranking member of the NYPD License Division, he supervised some 40 uniformed police employees and had ultimate authority to approve or reject licenses.

Epsinel, 47, worked for Dean. And Valastro, 58, who retired from the NYPD in 1999, owns the Valastro International Tactical Academy gun store in Queens.

Prosecutors revealed that they were implicated by two other former cops, Daniel Villanueva, 43, and Richard Ochetal, whose age was not immediately available, and a gun expediter named Frank Soohoo, 55. All three have pleaded guilty to bribery and other charges and cooperated with investigators.

From 2013 through 2016, Dean, Espinel, Villanueva and Ochetal “solicited and accepted bribes in exchange for providing assistance to the expediters’ clients in obtaining gun licenses quickly and often with little to no diligence,” the statement reads.

Acting U.S. Attorney Joon H. Kim speaks at a news conference in which arrests were announced in a federal gun licensing probe on April 25, 2017 in New York City. Spencer Platt / Getty Images

The expediters were identified by prosecutors as Valastro, Soohoo and Alex Lichtenstein, aka “Shaya,” who was sentenced last year to 32 months in prison for bribing police officers.

Their clients were able to get gun permits approved in a day, instead of the usual 30 to 40 days, prosecutors said. And the police officers who did their bidding did not look too closely at the people applying for the permits.

“They approved licenses for individuals with substantial criminal histories, including arrests and convictions for crimes involving weapons or violence, and for individuals with histories of domestic violence,” prosecutors said in their statement.

Paul Dean (L) and David Villanueva shown in this composite. victoralcorn.com

In the wake of the charges, NYPD Commissioner James O’Neill said he has purged the commanding officers of the NYPD Licence Division and changed the division’s policy to provide greater oversight.

‎"I'm absolutely appalled," O'Neill responded, when asked for his reaction to the latest charges.

If convicted, the accused all face up to 10 years in prison.