GUATEMALA CITY — Two days after prosecutors announced they would seek to lift President Jimmy Morales’s immunity, he ordered the expulsion of the head of a highly praised UN anticorruption commission and faced off with Guatemala’s top court and the international community.
It was a stunning reversal for a president whose predecessor was forced to resign two years ago by the same body’s investigation and who campaigned as the panel’s biggest advocate. ‘‘Neither corrupt nor a crook’’ was Morales’s campaign slogan.
What changed after the television comedian took office in January 2016 was that the United Nations commission and the prosecutors it has helped to train turned their sights on Morales and allegations of illegal campaign financing.
Morales denies any wrongdoing, and rumors swirled last week that his visit to UN headquarters in New York City was aimed at getting rid of the commission’s head, Ivan Velasquez.
On Friday afternoon, Velasquez stood beside chief prosecutor Thelma Aldana to announce they were asking a court to start the process for ending Morales’s immunity from prosecution, which would also need the support of Congress.
Morales’s 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 of government at George Mason University.
His order was temporarily blocked by Guatemala’s Constitutional Court, based on arguments that Morales has a fundamental conflict of interest.
At least one Cabinet minister resigned in protest, and the foreign minister was fired for refusing to expel Velasquez. People gathered in the capital 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’s party, but his brother and son have been ordered to stand trial for alleged tax fraud.
Morales remained defiant, issuing another statement later Sunday saying he stood by his original order.
‘‘He’s pushing the country into a constitutional crisis,’’ Burt said.
The chief prosecutor had said previously that she would resign if Velasquez was removed, so Morales may have been hoping 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 confirmed that Velasquez had her unconditional support and urged everyone to obey the Constitutional Court.
Prosecutors and the UN panel have won popularity over the past decade by beginning to hack away at Guatemala’s endemic corruption, including forcing Otto Perez 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 the government would declare a state of emergency and try to use security forces to clamp down, but Allison and Burt predicted Morales won’t be able to hold onto power, given the new political climate.
‘‘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 Perez Molina and his vice president, Roxana Baldetti, and 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 that perhaps they thought that with the political upheaval in the United States little attention would be paid to Guatemala.
Instead, the United States and other countries that support the commission issued a joint statement within hours of support for Velasquez. The US Department of State then issued a separate statement saying ‘‘it remains crucial that [the commission] be permitted to work free from interference by the Guatemalan government.’’