MEXICO CITY (Reuters) - A top Mexican prosecutor on Wednesday said judges were pushing defendants’ rights too far, pointing to a recent case where prosecutors had to accept a plea deal from a disgraced former governor or risk losing in court.

FILE PHOTO: Javier Duarte de Ochoa, former governor of Mexican state Veracruz, arrives to a court for extradition proceedings in Guatemala City, Guatemala, June 27, 2017. REUTERS/Luis Echeverria

Federal prosecutor Felipe Munoz told reporters he was forced to take a nine-year sentence for a guilty plea to money laundering charges from former Veracruz Governor Javier Duarte because he feared a court could throw out key financial information.

Duarte could serve much less time for good behavior. The plea deal sparked widespread outrage in Mexico over what is considered to be one of the biggest corruption cases uncovered in recent history.

Duarte had fled Mexico shortly before the end of his term in 2016 amid charges of embezzling sums that some estimates put in the hundreds of millions of dollars. He was detained in 2017 in Guatemala and extradited.

Despite efforts to bolster anti-money laundering laws, Mexico has struggled to mount successful prosecutions in a country awash with billions of dollars in illicit proceeds from drug trafficking, organized crime and theft of public money.

Reuters reported in August that a host of high-profile corruption cases, including Duarte’s, were at risk due to a November 2017 Supreme Court ruling that requires authorities to seek a judge’s consent before obtaining banking information.

Munoz said financial data in Duarte’s case had been obtained before the precedent.

“What happens if we go to trial and in the intermediate hearing they tell us: Illegal evidence? Do you know what? Duarte would be vacationing in Veracruz, Cancun or Miami right now,” Munoz said.

“They have applied this precedent retroactively,” he said. “It seems to me that this is generating impunity.”

The high court argued in its decision that judicial oversight was necessary to prevent abuses by prosecutors.

In August, a judge threw out corruption charges against a former teachers union boss, citing the Supreme Court ruling. The cases of five more detained ex-state governors facing trial on corruption charges may also be vulnerable, experts have said.

Duarte belonged to President Enrique Pena Nieto’s PRI party, which was defeated in a landslide by President-elect Andres Manuel Lopez Obrador in July.

Lopez Obrador, who takes office on Dec. 1, promises to end widespread corruption, but he will inherit a dysfunctional justice system that is trying to make a transition to oral, U.S.-style trials.