Bolivian police have arrested the leader of an attempted coup, hours after the presidential palace in the capital La Paz was stormed by soldiers.
Armoured vehicles and troops had taken up position on Murillo Square where key government buildings are located. They all later withdrew.
The rebel military leader in charge, Gen Juan José Zúñiga, had said he wanted to "restructure democracy" and that while he respected President Luis Arce for now, there would be a change of government. He is now under arrest.
President Arce condemned the coup attempt, calling on the public to "organise and mobilise... in favour of democracy".
"We cannot allow once again coup attempts to take Bolivian lives," he said in a televised message to the country from inside the presidential palace.
His words clearly resonated, with pro-democracy demonstrators taking to the streets in support of the government.
Arce also announced he was appointing new military commanders, confirming reports that Gen Zúñiga had been dismissed after openly criticising Bolivia's former leader, Evo Morales.
Morales also condemned the coup attempt and called for criminal charges to be brought against Gen Zúñiga and his "accomplices".
The public prosecutor's office has opened a criminal investigation.
It is increasingly clear that this was a short-lived and ill-judged military uprising rather than any wider unravelling of power.
Nevertheless, the coming weeks will be key in establishing whether Gen Zuñiga's military insurrection was just an isolated incident.
Certainly, the government now looks more vulnerable, and others may try to dislodge Arce's administration - albeit through politics rather than via the military.
Furthermore, he could count on the support of Evo Morales, the influential former president and the elder statesman of Bolivia's left.
Morales called on his supporters, particularly in the country's indigenous coca-growers movement, to take to the streets to demand an end to the attempt coup.
That display of popular power may well have helped strengthen the resolve against Gen Zuñiga's plans, which also included freeing "political prisoners" including former leader Jeanine Áñez.
Speaking from Murillo Square after it was taken by troops, Gen Zúñiga had said: "We are going to recover this homeland.
"An elite has taken over the country, vandals who have destroyed the country."
He was sacked after appearing on television on Monday, saying he would arrest Morales if he ran for office again next year, despite the former president being barred from doing so.
Formerly allies, Arce and Morales have not seen eye to eye on much recently, but they were united in their condemnation of the use of troops to force political change in Bolivia.
Indeed, in 2019, President Morales himself was forced out by military chiefs who said he was trying to manipulate the result of a presidential election, sending him into exile in Mexico.
Before Evo Morales took power in 2005, Bolivia was one of the most politically volatile nations in the Americas. His time in power brought much-needed stability to the Andean nation, at least until its ignominious end.
For his part, Arce - who was elected after a period of instability following the 2019 election - will have been heartened by the speed of the regional response.
Close allies like the left-wing governments in Venezuela and Colombia were quick to condemn what was happening and call for democracy to prevail. Washington also called for calm.
Even those Bolivians who opposed his socialist rule will not want to see a return to a dark time in South America where militaries with terrible human rights records often pushed out the country's democratically elected leaders at the barrel of a gun.
- BBC