Bolivian President Evo Morales has resigned amid turmoil following his disputed re-election last month.
On Sunday, international monitors called for the election result to be annulled, saying they had found "clear manipulations" of the 20 October poll.
Mr Morales agreed with the findings and announced his intention to call fresh elections - after overhauling the country's election body.
But politicians - and the army and police chiefs - had urged him to quit.
Some of his allies were attacked earlier this week, and said their homes had been set alight.
In a televised address, Mr Morales said he would resign as president, and urged protesters to "stop attacking the brothers and sisters, stop burning and attacking".
On the streets of La Paz, celebration - for millions of Bolivians, the demise of the region's longest-standing president could not have come soon enough.
In the end it was a call by the armed forces that signalled the end, telling Evo Morales he had to go for the sake of Bolivia's stability.
But while for many he was an undemocratic leader holding on to power, for others, especially poor Bolivians, Evo Morales was a president who gave a voice to millions. The first indigenous leader Bolivia ever had, he succeeded in making a deeply unequal society more inclusive.
His supporters have called this a coup - his detractors the end of tyranny. These are uncertain days in South America's poorest nation.
The Vice-President, Alvaro Garcia Linera, and Senate President Adriana Salvatierra, have also resigned.
Protesters took to the streets to celebrate, chanting "yes we could" and setting off fire crackers.
BBC
Russia's unmanned Luna-25 spacecraft has crashed into the Moon after spinning out of control, officials say.
Donald Trump has confirmed that he will not take part in Republican presidential debates with his rivals in the race for the White House.