In July of 2016, Lucrecia Hernández Mack, a forty-two-year-old public-health advocate, became the first woman to head Guatemala’s Ministry of Health. Her background was in think tanks, not politics, and Mack was cautious about accepting the position. Her mother, the indigenous-rights activist Myrna Mack, had been assassinated by the Guatemalan military, in 1990, during the decades-long civil war, and the country’s newly elected President, a former television comedian named Jimmy Morales, was a controversial figure among Guatemalan progressives, owing to his conspicuously thin credentials. Many of Mack’s friends and associates warned her against joining his administration. Yet years of government mismanagement and corruption had led to a public-health crisis—hospitals and health clinics across the country were short on medications, supplies, and vaccines, and preventable illnesses were spreading—and Mack felt that she had no choice. Before taking the job, though, she extracted a promise from Morales that the ministry would be hers to run without interference.

“Within the first week, it became clear just how deep the corruption ran in the ministry,” Mack told me recently. She and her staff discovered more than a thousand pending requests from politicians to give various ministry positions to friends, relatives, and associates. Public clinics were paying up to three times more for food and soap than they cost on the open market, because of inflated contracts with private sellers. For a decade, funds in the ministry’s annual budget had been allocated for a hospital in the department of Huehuetenango, in the western highlands, but all that existed of it were the outer walls. The actual hospital was never built.

Mack immediately filed complaints with both the Attorney General’s office and the International Commission Against Impunity in Guatemala, known as the CICIG, an independent anti-corruption agency overseen by the United Nations and supported by the United States. Staffed with Guatemalan and international investigators, the group was founded in 2006, in an effort to root out a group of repressive state-security agencies that had formed during the civil war, which had ended ten years earlier, and it went on to help prosecute more than a hundred cases, leading to charges against nearly seven hundred people involved in more than sixty criminal networks nationwide. “The Guatemalan government could not clean itself up on its own,” Adriana Beltrán, of the Washington Office on Latin America, told me. “It needed the CICIG to help fix its institutions.” In 2015, Guatemala’s Attorney General, Thelma Aldana, working with the CICIG, charged President Otto Pérez Molina and Vice-President Roxana Baldetti with racketeering and fraud, and both resigned. (Pérez Molina is in jail awaiting trial; Baldetti, who was convicted last year, is serving a fifteen-year sentence.) Their resignations paved the way for the election of Morales, who ran as an outsider. His slogan was “Not corrupt, nor a thief.”

As Mack started to remake the Health Ministry, with assistance from the CICIG, she came under attack by politicians and businessmen who had profited under the old order. They accused her of embezzlement and nepotism and launched smear campaigns against her and her staff, online and in the media. “We went in knowing the work would be hard, and we still underestimated the force of the opposition,” she said. Morales was tolerant of Mack’s efforts at first—“he had a health crisis he needed us to fix,” she told me—but within months he and his family had come under investigation by the CICIG for campaign-finance violations and money laundering. He began to criticize the anti-corruption campaign as a usurpation of his power, and he distanced himself from Mack’s efforts in the ministry. In August, 2017, Morales announced that he was expelling the CICIG’s commissioner, a Colombian named Iván Velásquez, from the country, and Mack resigned.

Next month, Guatemala will hold a general election, and Mack is running for Congress under the banner of an anti-corruption party called Movimiento Semilla.“The lesson we learned at the ministry was that if you want to implement health policies, you need healthy institutions,” she said. Last year, Morales announced plans to curtail the CICIG’s operations, claiming that it had engaged in “selective criminal prosecution with an ideological bias.” He attempted to cancel the investigators’ visas and suspend their diplomatic credentials. When a Guatemalan court blocked him, Morales responded by attacking the judges and briefly detaining one of the commission’s investigators. In January, he tried to shut down the CICIG altogether, and the court intervened once again to stop him. Velásquez, the commissioner, remains barred from the country. The CICIG has continued to operate anyway, albeit in reduced form. Its mandate, which was renewed two years ago, is due to expire in September.

By the time the Presidential campaign began in full, earlier this year, seventy per cent of Guatemalans supported the CICIG, and one of the leading candidates for President was Thelma Aldana, who had worked closely with the group for the four years that she was Attorney General. Last year, she decided to forgo running for another term and, like Mack, she eventually joined Movimiento Semilla. Among the front-runners for President, Aldana was the only one to vow to support the CICIG and continue its mission.

The campaign against Aldana began even before she declared her candidacy. When Aldana left the Attorney General’s office, Felipe Alejos, the leader of a rival political party and the vice-president of the National Congress, filed a raft of lawsuits against her, alleging corruption and influence peddling. (Aldana had brought charges against Alejos when she was Attorney General.) According to the Salvadoran news site El Faro, Aldana had personally led some five hundred investigations into businessmen, drug traffickers, mayors, members of Congress, and government ministers during her tenure. Now some of them were trying to cripple her candidacy. There were accusations that she had overseen the improper purchase of a government building while in office and that she had overpaid cronies with public funds. Some of the claims (including the building purchase) were promptly disproved; others were harder to rebut because charges were brought under special proceedings, and Aldana was not permitted to publicly contest the evidence against her. Mack told me, “If I was in government for thirteen months, trying to clean house at the health ministry, and I made all the enemies that I did, then just imagine what it must be like for Aldana, who spent four years working with the CICIG.”

In March, while Aldana was in El Salvador for a meeting, a Guatemalan judge issued a warrant for her arrest, on charges of paying a consultant for a nonexistent job at a national university, when she was Attorney General. She denied any impropriety, but, because of the charges, her certification as a candidate was revoked. Earlier this month, the Constitutional Court upheld the suspension of her candidacy. She can appeal to the Supreme Court, but not in time to get a ruling before the elections, so the decision has effectively ended her Presidential bid. “This is an enormous step back,” Álvaro Montenegro, an activist who helped organize national protests against government corruption in 2015, told me. “It’s hard to know where we go from here.”