Morales’s resignation leaves behind a political vacuum the country may struggle to fill.

Evo Morales, Bolivia‘s longest-serving leader and its first indigenous president, announced his resignation on Sunday after weeks of intense protests sparked by a dispute over the results of the October 20 election.

Senate vice president and opposition leader Jeanine Anez, 52, declared herself interim president on Tuesday after Morales sought asylum in Mexico.

Morales accused his opponents, including election rival Carlos Mesa and protest leader Luis Fernando Camacho, of conspiring against his government.

“The world and our Bolivian patriots repudiate the coup,” he said in a tweet. At the time of his resignation, Morales and his Vice President Alvaro Garcia Linera said in a televised address that they were stepping down in an effort to put an end to the unrest that had spread across the country and paralysed daily life.

Anez has rejected the allegations of a coup.

As the country continues to be gripped by unrest, here’s a look at what led to Morales’s resignation and what happens next.

What sparked the unrest?

Morales, a 60-year-old former coca leaf farmer and union leader, once enjoyed overwhelming popularity among Bolivians. He is credited with bringing steady growth to Latin America‘s poorest country.

But analysts say the left-wing president lost significant popularity, including among his own supporters after defying the results of a referendum on presidential term limits and insisting on running for a fourth term.

Woman protesting during a demonstration in support of Bolivian President Evo Morales after he announced his resignation in Buenos Aires, Argentina [Agustin Marcarian/Reuters]

That discontent was amplified as the election results began rolling in late on October 20, and continued the weeks after as Morales claimed he was the outright winner.

On the night of the election, initial results showed Morales short of the 10 percentage points over his main opponent needed to win outright in the first round. Publication of results was then abruptly halted without explanation for 24 hours. When publication resumed, it showed Morales with just enough votes to avoid a risky second round.

This set off weeks of angry protests that shuttered schools and businesses across the country, with demonstrators accusing Morales of undermining the country’s democracy. Morales loyalists also took to the streets in large numbers, voicing their support for the country’s leader.

A woman holding a sign reading ‘Evo out’ during a protest against Bolivia’s President Evo Morales in La Paz, Bolivia [Carlos Garcia Rawlins/Reuters]

On Sunday, the Organization of American States (OAS) delivered a report detailing serious irregularities during the vote, and the armed forces announced that they sided with the protesters and demanded that he resign, prompting ruling party allies to quit.

“There was significant evidence of fraud,” said Jim Shultz, executive director of the Democracy Center.

“People across the country have been protesting in the streets, not just right-wing opposition to the government but also a lot of people from progressive social movements around the country,” Shultz told Al Jazeera.

Luis Fernando Camacho, a Santa Cruz civic leader and major opposition figure, talking to supporters from a police car in La Paz, Bolivia [Carlos Garcia Rawlins/Reuters]

Bolivian political analyst Franklin Pareja said Morales initially appeared intent on weathering the storm, but the military turning on him and the subsequent resignation of his own party members was akin to an “implosion” in Morales’s government.

“The streets, the armed force, the international community left him without alternative and, finally, he was obligated to resign,” Pareja told Al Jazeera.

Despite this, Pareja said Morales remains strong with a very strong party, who wielded support of more than a third of the population. But it is a significant drop for a leader who once garnered 70 percent public support.

What have been the international reactions?

The United States expressed support for the developments in the country, and urged Bolivia’s legislative assembly to meet “sooner rather than later” to formally accept Morales’s resignation.

“After nearly 14 years and his recent attempt to override the Bolivian constitution and the will of the people, Morales’s departure preserves democracy and paves the way for the Bolivian people to have their voices heard,” US President Donald Trump said in a statement.

Trump said the events in Bolivia “send a strong signal to the illegitimate regimes in Venezuela and Nicaragua that democracy and the will of the people will always prevail. We are now one step closer to a completely democratic, prosperous, and free Western Hemisphere.”

Left-wing ally, Mexico, however, decried the events as a “coup” and granted Morales asylum. Morales landed in Mexico City on Tuesday.

Other left-wing governments in the region, including in Nicaragua and Venezuela also came to Morales’s defence.

Meanwhile, Argentina and Peru, among other South American countries, called for a return to calm and peaceful transition of power.

Bolivian Senator Jeanine Anez gestures after she declared herself Interim President of Bolivia, at the balcony of the Presidential Palace, in La Paz, Bolivia [Henry Romero/Reuters]

What will happen next?

As Morales’s opponents celebrated his departure, they also scrambled to find a temporary successor.

Anez flew into the capital La Paz and announced on Sunday that she was willing to take control. According to the Bolivian constitution, she would serve as interim president and be tasked with holding election within 90 days.

But her arrival at the presidential palace faced an immediate challenge from politicians loyal to Morales.

Late on Tuesday, she declared herself interim president despite a lack of quorum to formalise her appointment. The legislative session was boycotted by Morales’s party.

“There is a problem of legality in whatever outcome,” John Crabtree a researcher at the University of Oxford told Al Jazeera.

Crabtree added that Bolivian society is sharply divided along geographic, social and ethnic lines, where Morales’s opponents are located in the east of the country, in the low lands and come from middle-class backgrounds. Whereas his supporters are working class or reside in the country’s rural areas in the highlands. This division is only likely to be exacerbated further.

Supporters of Bolivian President Evo Morales and opposition supporters clash during a protest in La Paz Bolivia [Carlos Garcia Rawlins/Reuters]

Meanwhile, dozens of protesters gathered in the square of the presidential palace on Monday to guard it against vandalism as residents worried the country would descend into lawlessness.

“We are neighbours, we have been here since Friday supporting the people, we are not part of any political group we are here for the belief that this could be resolved peacefully,” a protester who requested to be identified by his first name Vany, told Al Jazeera.

“We are part of civil resistance and we are protecting the square,” he said.

Sergio Pacheco, another protester said that residents have been organising neighbourhood watches.

“This morning there is a dense calm, there is collective paranoia over looting and vandalism,” Pacheco said.

“We are here out of conviction, we are fighting for what saw was a big snowball that started with election fraud, everyone here is for this reason because they want a democracy, a real one.”

With additional reporting by Monica Garcia in La Paz.