For months, Guatemalan President Jimmy Morales has been trying to stop a United Nations-backed anti-corruption investigation into his government.

Morales, a stand-up comedian who ran for president in 2015 with the slogan “Not corrupt, nor a thief,” is accused of campaign finance violations. His administration is under investigation by the International Commission Against Impunity in Guatemala, an influential international corruption panel called “CICIG” in Spanish.

Last September, Morales told CICIG investigators they were no longer welcome in Guatemala and denied a visa to lead prosecutor Ivan Velasquez. The courts quickly ruled that Velasquez must be allowed to re-enter Guatemala to continue his work, but Morales has refused.

On Jan. 6, immigration officers sent by Morales arrested Velasquez’s deputy prosecutor at the Guatemala City airport. The Constitutional Court ordered his release and reiterated that the government must let the CICIG continue its investigation.

Instead, Guatemala’s solicitor general began impeachment proceedings against three of the court’s five justices, saying they had exceeded their authority by ruling on foreign affairs issues.

More is at risk than the United Nations’ work. The showdown between Morales and Guatemalan courts has plunged the country into crisis, and its democracy hangs in the balance.

What is the CICIG?

The United Nations, European Union and United Kingdom have all condemned Morales’ moves to oust the CICIG.

Protests that started small – a few thousand demonstrators marching through Guatemala City over the Jan. 12 weekend – are now spreading across the country.

Morales has reason to be worried.

The CICIG was invited into Guatemala in 2007 to eliminate “clandestine illegal armed groups” – criminal networks that have infiltrated its government. These shadowy webs of corruption, the subject of my 2017 book on Guatemala, include smuggling rings with ties to the military and presidents and drug traffickers who bribe or threaten judges.

As a result, criminals operate with impunity in Guatemala. Around 90 percent of all crimes go unpunished – which is actually an improvement over the country’s 2007 impunity rate of 98 percent.

The CICIG is a bold and unprecedented experiment to improve justice in Guatemala by outsourcing it. Working hand in hand with the Guatemalan attorney general’s office, CICIG prosecutors have helped convict 310 government officials, high-profile business leaders and crime bosses.

In 2015, the CICIG helped Attorney General Thelma Aldana bring down Guatemalan President Otto Pérez Molina for corruption – a stunning achievement in a country where politicians have long been untouchable. Pérez Molina and his vice president, Roxana Baldetti, were forced to resign after massive street protests erupted following an investigation into a massive customs scandal.

Both remain in jail awaiting trial for fraud and taking bribes, though Baldetti was already sentenced to more than 15 years in an unrelated embezzlement case.

CICIG prosecutors currently have 84 major investigations underway, according to its website. Most of them include large numbers of defendants. One of them focuses on President Morales.

By banning the CICIG, Morales is trying to avoid his predecessor’s fate.

He may also be hoping to help his son and brother, who are being tried for defrauding the government before Morales even took office.

A slow-motion coup

Morales has his supporters. U.S. Sen. Marco Rubio, for example, has suggested that CICIG prosecutors have at times overstepped their mandate.

But many observers in Guatemala argue that Morales’ actions amount to a kind of slow-motion coup.

Rather than overthrowing a democratically elected leader using military force, they say, Morales is using Guatemala’s armed forces to eliminate threats to his power and dispatching his attorney general to hobble the judiciary for opposing his actions.

The damage done may be just as dramatic – and violent – as a military coup.

The CICIG is credited with contributing to Guatemala’s dramatic reduction in homicides, which dropped from 45 killings per 100,000 residents in 2009 to 23 per 100,000 residents in 2016. Other factors have certainly helped, including changes made to how Guatemalan police patrol gang-infiltrated neighborhoods.

But the Crisis Group, which studies international conflict, calculates that between the convictions it has won and the judicial system reforms it has implemented, the CICIG may have prevented as many as 4,500 homicides in Guatemala since 2007.

Guatemala is still deeply troubled. Parts of its government remain corrupted by organized crime, and it is one of the world’s deadliest countries.

But like many Central America observers, I believe the CICIG has undoubtedly strengthened the rule of law, holding powerful people responsible for the corruption and impunity that has long defined life in Guatemala.

This progress may end if Morales succeeds in banning its investigations.

The global consequences of Guatemala’s constitutional crisis

The consequences of Guatemala’s crisis will go well beyond its borders.

More undocumented migrants detained crossing the United States’ southern border come from Guatemala than from any other country. The collapse of its democracy would surely send even more desperate residents fleeing.

Morales’s crusade against the CICIG also endangers similar anti-corruption efforts in neighboring countries.

Inspired by the achievements of the CICIG, Honduras in 2016 worked with the Organization of American States to launch the Mission to Support the Fight against Corruption and Impunity in Honduras, a young but promising attempt to strengthen the rule of law there.

El Salvador, the most violent Central American country, is hoping to do the same soon.

Guatemala’s crisis weakens these international partnerships. If a president can terminate an investigation when it threatens his power, can justice ever really be served?