Bolivian President Evo Morales has resigned after nearly 14 years in power, amid turmoil following his disputed re-election last month.
The head of the army had called on him to go after protests over his election win.
Auditors found irregularities with the poll but Mr Morales said he had been the victim of a coup.
He said he was leaving to help protect families of political allies, after their homes were burned down.
In a televised address, Mr Morales urged protesters to “stop attacking the brothers and sisters, stop burning and attacking”.
The biggest criticism of Evo Morales was his lack of respect for Bolivia’s democracy – accused of overstaying his welcome and refusing to step down.
But the fact that the military has called the shots on the president standing down does not do much for Bolivia’s democracy either.
Now Evo Morales has gone, there is a power vacuum. Increasing numbers of his Mas party are resigning, and it feels like there is a need for retribution – for Evo Morales and his people to pay the price for the mistakes they made while in power.
His supporters have called this a coup – his detractors the end of tyranny. The priority now is to choose an interim leader, call new elections and bring a polarised Bolivia together or face yet more unrest and violence in the coming weeks.
Vice-President Alvaro García and Senate President Adriana Salvatierra also resigned.
Protesters took to the streets to celebrate, chanting “yes we could” and setting off fire crackers.