Brazilian President Michel Temer can keep his job after the country’s Superior Electoral Court acquitted him of corruption charges on Friday. The case involved allegations of illegal campaign donations made during the 2014 election, when he was running for vice president alongside presidential candidate Dilma Rousseff. He replaced Rousseff when she was impeached in a different case in 2016.

Four out of the bench’s seven judges voted to keep Temer in office, with some arguing that maintaining political stability was crucial in the country at the moment. “Brazil has a history of great instability . . . it’s this reality we are dealing with,” the president of the court, Gilmar Mendes, said, according to the Financial Times. However, judge Herman Benjamin, the rapporteur in the case, said it was “incontestable that the crimes occurred”.

In May, thousands of citizens had taken to the streets demanding Temer’s resignation. This had prompted Temer’s government to deploy armed forces to assist the police in maintaining law and order in the country’s capital. The move to deploy the Army, which was authorised based on a presidential decree, drew immense criticism.

Temer took over as president while the country was in the throes of a severe political crisis. Rousseff was impeached for mishandling the country’s budget and misrepresenting the economy.