MEXICO CITY - Operation Cleanup was a showcase effort to stamp out corruption within Mexico's elite organized-crime bureau.

Twenty-five top law enforcement officials were arrested in the weeks after the operation was launched in 2008, most accused of acting as highly paid moles for a leading drug cartel, the very villains the officials were supposed to be chasing.

Today, the cases against them are a shambles, yet another example of Mexico's systemic corruption and a weak judiciary unable to fix it. The operation is also the most high-profile prosecution among the many that fell apart under the government of President Felipe Calderón, which ended nearly five months ago.

This week, a federal judge freed the highest-ranking of those ensnared by Operation Cleanup. Noe Ramirez Mandujano, Mexico's former anti-drug czar, was absolved and released from prison, where he had awaited this outcome for 4 1/2 years.

On Wednesday, federal prosecutors dropped organized-crime charges against a retired army general accused of aiding a drug cartel after determining that the witness testimony was not enough to sustain their case.

Retired Gen. Tomas Angeles Dauahare will be released from a maximum-security prison in Mexico state, where he has been held since his arrest last year. Angeles Dauahare was charged with protecting members of the Beltran Leyva cartel.

In a particularly scathing ruling issued Monday, Judge Mauricio Fernandez de la Mora said government prosecutors used sketchy testimony from unidentified "protected witnesses" who lied, made up evidence and were clearly coached.

One of the government's "star" protected witnesses, code-named Jennifer, had testified that Ramirez received $450,000 from the once-powerful Beltran Leyva cartel in exchange for inside information, including the timing of raids and sensitive security details. Fernandez indicated that the story seems to have been fabricated.

In addition to releasing Ramirez, Fernandez ordered Jesus Murillo Karam, the attorney general in the new government of President Enrique Peña Nieto, to investigate whether prosecutors in charge of Operation Cleanup broke the law in the attempt to build their cases.

The top prosecutor in charge was Eduardo Medina Mora, Calderón's first attorney general who now works for Peña Nieto's government as its ambassador to Washington.

Of the 25 officials arrested in 2008, only 13 were formally charged. Of those, eight have been released, including the most senior officials in the group. Three are in prison awaiting rulings on their cases and a fifth was acquitted of charges related to Operation Cleanup.

The investigation targeted a bureau within the federal Attorney General's Office known then as SIEDO, the top body for prosecuting organized crime, including drug trafficking. Ramirez headed it. The agency has since changed its acronym slightly but not its duties.

Ramirez has not commented since his release. Another of the accused, Victor Garay, a former federal police chief who was freed late last year, bitterly complained to reporters then that he was a political pawn in a scheme to weaken the police force. He accused prosecutors of faking evidence against him by using confidential informants who are nothing more than "confessed criminals."