Image copyright Getty Images

Bolivia's President Evo Morales has now left the country after a controversial election there.

His resignation on Sunday sparked clashes in cities across the country, according to local media reports.

There have also been protests in several neighbouring countries over what's happened, with claims of corruption and foreign interference.

But if you're coming to the story for the first time, there's a lot to take in.

So if that sounds like you, let's start from square one and bring you up to speed.

Bolivia basics

Image copyright Getty Images

Around 11 million people live in Bolivia, which stretches from the Andes mountains in the west to the Amazon rainforest in the east.

You can see the national symbols on the country's flag - the condor and the llama.

Bolivia gained independence from Spain in 1825 - and like much of south and central America - it now contains a mixture of people descended from both Spanish ancestors and the indigenous people of the area.

But it's important to know that indigenous people make up around two thirds of the population.

Dozens of indigenous languages are still widely spoken including Quechua which derives originally from the Inca people who ruled the region hundreds of years ago.

From farmer to president

Image copyright Reuters

Former coca farmer Evo Morales, 60, was elected to lead Bolivia in 2005 - the first president to come from an indigenous background.

Back then, 38% of people there were classed as living in extreme poverty and he was praised for getting that figure down.

He's left-wing, and nationalised the country's oil and gas industries.

You can read more about his run as Bolivia's president here.

So what sparked the current trouble?

Some claim that after almost 14 years in power, Evo Morales shouldn't have been allowed to run for president again.

But he was allowed to stand following a decision from the country's Constitutional Court.

So before a single vote was cast on 20 October, this was a controversial election.

When the count showed a win for Mr Morales, there were claims of corruption from supporters of his opponent Carlos Mesa.

Then a monitoring group - the Organisation of American States - agreed there had been "manipulation" and called for the result to be cancelled.

Image copyright Getty Images Image caption The army telling the president to step down has led to claims of a coup

Crisis or coup?

Protests turned ugly as the days mounted up with no clear election result - at least three people died in clashes.

Media playback is unsupported on your device Media caption Ballot boxes and electoral offices were set on fire by protesters

And it wasn't just a matter of holding a fresh election.

Crucially, Evo Morales lost the support of Bolivia's armed forces, and was finally forced to quit at the weekend.

That led him to describe what happened as a coup - a military takeover.

His supporters clashed again with the police, while his opponents took to the streets to celebrate.

Image copyright AFP Image caption Supporters of Carlos Mesa celebrate the resignation of Evo Morales

International reaction

President Trump says he "applauds the Bolivian people for demanding freedom".

Russia, on the other hand, claimed Mr Morales had won the election but couldn't take power because of a "wave of violence".

Mexico, which also has a left-wing leadership, echoed Mr Morales' claim of a coup.

Mr Morales has now travelled to Mexico, claiming he'll return to Bolivia with more "strength and energy".

So who's in charge now?

The deputy head of Bolivia's Senate, Jeanine Áñez, has offered to take over as interim president until fresh elections can be held.

But the atmosphere's tense, with the army now called in to back up the police against pro-Morales demonstrators.

It's a delicately-balanced situation, with reports of looting and vandalism.

Already, 20 people have been injured as fresh protests grow.

Follow Newsbeat on Instagram, Facebook, Twitter and YouTube.

Listen to Newsbeat live at 12:45 and 17:45 weekdays - or listen back here.