A high court ruling barring a crusading former prosecutor's candidacy has turned Guatemala's presidential election on its ear less than a month before the vote, and raised concerns about what will happen to years of efforts to fight endemic corruption.

The rejection of Thelma Aldana's appeal means at least two of the top three candidates according to polls will not appear on the June 16 ballot, and analysts said Thursday the Aldana decision in particular appeared to spring from fears over her zealous prosecutions of corruption in politics and business.

"I think that the deeply entrenched, established powers that be in Guatemala are absolutely terrified of a candidate like Thelma," said Christine Wade, a political scientist at Washington College in Maryland. "She has a proven record as attorney general of jailing former presidents and vice presidents. ... And it's really difficult to see this constitutional court decision as anything other than politically motivated."

Aldana's candidacy was denied on the grounds that she lacked a document accrediting that she didn't have any outstanding accounts after having been responsible for public funds from her time in office.

Zury Ríos Sosa, the daughter of former dictator Efraín Ríos Montt had already been ruled ineligible due to a constitutional clause on relatives of former leaders running. Mauricio Radford was barred for having an ongoing corruption case against him. And a third candidate, Mario Estrada, is out after he was arrested in the United States and accused of drug trafficking charges.

Polls have shown Ríos Sosa and Aldana alternating in second and third place after former first lady Sandra Torres — who is also expecting a Constitutional Court ruling on whether she will be able to run despite allegations of illicit party financing dating to a previous run for the presidency in 2015.

In the eyes of constitutional lawyer Alejandro Balsells, the rulings are wrongheaded decisions that go against electoral principles and are a clear attempt to deter certain people from participating.

"The courts are ceasing to protect human rights. They are disassociating from previously held positions," Balsells said. "They are divided decisions that when there are doubts, the best option is to vote for freedoms and not restrict them. The presumption of innocence is violated."

"If it is in good faith, it demonstrates terrible ignorance. If it is in bad faith, it demonstrates a really messed up cooptation," Balsells continued.

The June election will pick a successor to President Jimmy Morales, who is constitutionally prohibited from seeking a second term. Morales ran for office on the slogan "neither corrupt, nor a thief," but in office he has been dogged by graft probes targeting him, his family and inner circle. He has not been charged — lawmakers have repeatedly declined to lift the immunity he enjoys as sitting president — and denies wrongdoing.

Investigations of Morales were initially pushed by Aldana, who had already made a name for herself by jailing former President Otto Pérez Molina, his vice president and Cabinet members, perhaps the most high-profile of dozens of investigations.

Morales has also moved to kick out a U.N.-sponsored anti-graft investigative commission known as CICIG that worked closely with Aldana to shine light into the infiltration of drug money, illicit campaign financing and bribery into politics. Morales gave CICIG until September to wrap its work up and leave the country — four months before the next president takes office in January.

With Aldana out of office and CICIG on its way out, many fear that hard-won gains on fighting graft are at risk, and that has been on many voters' minds.

"This was a very important moment for Guatemala because what was at stake was the continuity of the effort to really tackle impunity and corruption in the country, and how do you bring about structural reforms," said Adriana Beltrán, an analyst at the Washington Office on Latin America, which advocates for human rights in the region.

Beltrán noted that polls show around 70% of Guatemalans support CICIG's work, and an Aldana presidency was seen "as a threat to the continuation of the status quo and to the ability to ensure impunity" for corrupt and powerful interests.

"I think it was evident that the corrupt sectors in Guatemala came together to prevent (Aldana's) participation at all costs," Beltrán said, while adding that the ruling of the Constitutional Court "should be respected to prevent any further breakdown of the rule of law in the country."

Cesar Sigüenza, a lawyer who works in parliamentary analysis, predicted that Guatemalans would turn out to vote in June less out of enthusiasm or confidence than out of a simple hope for something to change.

And with all the shake-up on the ballot, it's unclear what the prospects are for the outcome.

"In general, we are on the verge of elections where it is very difficult to venture to say who will be the one to benefit from the votes that are up in the air," Sigüenza said.

Wade said Washington has shown little interest in trying to support CICIG or its work.

"I think there's not much interest in addressing corruption in the region even though it's clearly been shown to be a root cause of migration, particularly out of Honduras and Guatemala," Wade said.

___

Associated Press writer Peter Orsi contributed to this report from Mexico City.