Two days after prosecutors announced they would seek to lift Guatemalan President Jimmy Morales’ immunity, he ordered the expulsion of the head of a highly praised U.N. anti-corruption commission and plunged into a faceoff with the nation’s top court and the international community.

It was a stunning reversal for a president whose predecessor had been forced to resign by the same body’s investigation two years earlier and who campaigned as the panel’s biggest advocate. “Neither corrupt nor a crook” was Morales’ campaign slogan.

What changed after the television comedian took office in January 2016 was that the U.N. commission and the aggressive Guatemalan prosecutors it has helped train turned their sights on him and allegations of illegal campaign financing.

Morales has strenuously denied any wrongdoing, and rumors swirled last week that Morales’ visit to U.N. headquarters in New York was aimed at getting rid of the commission’s head, Iván Velásquez.

On Friday afternoon, Velásquez stood beside chief prosecutor Thelma Aldana to announce that they were asking a court to start the process for removing Morales’ immunity from prosecution, a move that would eventually need the support of Congress.

Morales’ response “is based on his own personal interest,” said Jo-Marie Burt, a senior fellow with the Washington Office on Latin America and a professor in the school of public policy and government at George Mason University.

His order quickly was blocked by Guatemala’s Constitutional Court, which temporarily suspended the expulsion while it studies the case, based on arguments that Morales had a fundamental conflict of interest. At least one Cabinet minister resigned in protest and the foreign minister was fired for refusing to expel Velásquez. People gathered in the capital in several spots to demonstrate against the decree, and the United States, European Union, and others expressed deep concern about the president’s action.

Not only are prosecutors investigating the campaign financing of Morales’ party, but his brother and son have been ordered to stand trial for an alleged tax fraud scheme.

Morales remained defiant, issuing another statement later Sunday saying he stood by his original order in spite of what the court ruled.

“He’s pushing the country into a constitutional crisis,” Burt said.

The chief prosecutor had said previously that she would resign if Velásquez was removed, so Morales may have been hoping that he could get rid of the two leaders of the country’s anti-graft efforts. But once the court stepped in, Aldana said she was staying as chief prosecutor, dissent appeared within the president’s administration and protesters took to the streets.

Late Sunday, Aldana issued a statement confirming that Velásquez had her unconditional support and urging everyone to obey the Constitutional Court.

Working together, local prosecutors and the U.N. panel have won popularity over the last decade by beginning to hack away at corruption long endemic in Guatemala, including forcing Otto Pérez Molina from the presidency in 2015.

“An attack upon them is an attack upon everyone in Guatemala who is fighting for a better country,” said Mike Allison, a political science professor at the University of Scranton.

Some people worried about the potential for the government to declare a state of emergency and try to use security forces to clamp down, but both Allison and Burt predicted Morales won’t be able to hold onto power, given the new political climate in Guatemala. “It’s going to be a matter of days, maybe even hours,” Burt said. “His presidency in my mind is over.”

Two years ago, corruption allegations were mounting against Peréz Molina and his vice president, Roxana Baldetti, and public protests went on for months. Eventually both resigned quietly and they remain in jail awaiting trial.

Elizabeth Oglesby, a professor at the Center for Latin American Studies at the University of Arizona, said Morales and his advisers “miscalculated about the broader political moment.”

She said perhaps they thought that with the political upheaval in the United States there would be little attention paid to Guatemala.

Instead, the U.S. and other donor countries that support the commission issued a joint statement within hours voicing their support for Velásquez. The U.S. State Department then issued a separate statement saying “it remains crucial that [the commission] be permitted to work free from interference by the Guatemalan government.”

SONIA PEREZ D.

CHRISTOPHER SHERMAN