A corrupt cop who was serving a lifetime prison sentence for executing people on behalf of the mob died behind bars.

Stephen Caracappa — who was busted along with Louis Eppolito for working with the Lucchesse crime family while serving with the NYPD — died at a medical detention facility in Butner, North Carolina, on April 8, according to prison records and law enforcement sources. He was 75 years old.

It wasn’t clear what caused his death, though Caracappa has battled cancer in the past.

In 2006, Caracappa and Eppolito were convicted for serving as Mafia hitmen while they were members of the police force.

Caracappa was sentenced to life plus 80 years in prison for his crimes.

One of the victims, 26-year-old Nicholas Guido, was killed outside his mother’s Brooklyn home on Christmas Day 1986 in a case of mistaken identity.

Guido had the same name as a mobster who was being sought.

The city paid millions of dollars to settle civil litigation stemming from the murders.

Reached at his Florida home Monday, a relative of Caracappa declined to comment.

Eppolito and Caracappa were long suspected of carrying out murders and feeding the mob information, but had managed to live above the law until a convicted drug dealer decided to turn on them.

Mob turncoat Burton Kaplan took the stand in 2006 to detail how he acted as a go-between with the two detectives.

Kaplan hired the two detectives to kill diamond dealer Israel Greenwald, who had been cooperating with an FBI investigation.

The detectives used a police database to find Greenwald’s address and eventually pulled over his car before taking him to a warehouse on Nostrand Avenue, where he was murdered.

Greenwald’s body was buried in a garage at the location for nearly two decades until a cooperating witness revealed its location in 2005.

Greenwald’s eldest daughter, Michal, wrote about the tragedy after her father’s remains were finally discovered.

“So long as you are alive, you must pay for what you did to my father that day in 1986,” Michal wrote in 2009. “You must pay for what you stole from us and what we will never ever get back.”