By LARRY McSHANE

Associated Press Writer

NEW YORK (AP) — In a stunning blow to federal prosecutors, a Brooklyn judge on Friday tossed out the racketeering convictions of two former NYPD detectives who were found guilty two months ago of participating in eight murders while on the payroll of a brutal mob underboss.

Louis Eppolito and Steven Caracappa, who have been described as the most corrupt officers in New York police history, were also granted new trials on lesser charges by U.S. District Judge Jack Weinstein. Less than a month ago, Weinstein had told the “Mafia Cops” that they were responsible for “the most heinous series of crimes ever tried in this courthouse.”

But the judge, in Friday’s 77-page ruling, said he was compelled to set aside the verdict — in spite of what he called their obvious guilt — because the five-year statute of limitations for the worst of the pair’s crimes had passed.

“The evidence at trial overwhelmingly established the defendants’ participation in a large number of heinous and violent crimes,” he wrote. “Nevertheless … the five-year statute of limitations mandates granting the defendants a judgment of acquittal on the key charge against them — racketeering conspiracy.”

Federal prosecutors immediately promised to appeal the decision.

The detectives either committed or facilitated the murders while working with the NYPD between 1986-90, prosecutors said. But once the pair retired to Las Vegas in the ’90s, “the conspiracy that began in New York in the 1980s had come to a definite close,” the judge ruled. “The defendants were no longer in contact with their old associates in the Luchese crime family.”

Weinstein granted the pair a new trial on drug charges and Eppolito a new trial on money laundering charges, saying their convictions on those charges were tainted because they were linked to the most serious counts.

He added, however, that if an appeals court reverses his ruling, Eppolito and Caracappa should be denied a new trial and their life sentences served.

Defense attorneys had argued that the statute of limitations had expired on the most serious allegations against the pair, who allegedly spent four years on the payroll of both the New York Police Department and Luchese crime family underboss Anthony “Gaspipe” Casso. Testimony showed the two earned $65,000 for one of the slayings.

Prosecutors had countered that the murders were part of an ongoing conspiracy that lasted through a 2005 drug deal with FBI informant Steven Corso.

“I am very happy,” said Edward Hayes, Caracappa’s trial lawyer. “It’s exactly what we argued during the trial. I am very happy for my client, and I do feel it is a vindication of our trial strategy.”

In one of the trial’s many strange twists, Hayes was called to court earlier this week to testify after Caracappa sought a new trial based on poor representation at the trial.

Weinstein threw out the racketeering charges just 25 days after he told the pair they would receive life in prison on their convictions. There’s now a chance that the pair, jailed immediately after their April 6 convictions, could be out on bail next week.

“We’re extremely relieved,” said attorney Joseph Bondy, who now represents Eppolito. “We’re ecstatic.”

The lawyer said he would return to court next week to ask for bail for Eppolito. Robert Nardoza, a spokesman for the U.S. Attorney’s Office, said prosecutors would appeal.

“Based on the law given to them by the court, each of the 12 jurors specifically found that the defendants’ heinous crimes were committed within the statute of limitations,” Nardoza said.

Eppolito, 57, whose father was a member of the Gambino crime family, and the 64-year-old Caracappa were respected detectives who led a double life as mob hit men, prosecutors said, receiving $4,000 a month from Casso, a brutal underboss responsible for three dozen murders.

Caracappa retired in 1992 after establishing the police department’s unit for mob murder investigations. Eppolito, the more colorful of the pair, was a much-praised street cop who went on to play a bit part in “GoodFellas” and launched an unsuccessful career as a screenwriter.

 .