Video: Troubled Ecuador in state of siege
Ecuador is under a state of siege, with the military in charge of public order, after soldiers rescued President Rafael Correa from a hospital where he had been surrounded by police who assaulted and tear-gassed him.
Mr Correa and his ministers said Thursday's revolt - in which rebels also paralysed the nation with airport closures and road blockades - was an attempt to overthrow him and not just a simple protest over a new law which would cut benefits for public servants.
At least three people - two police officers and a soldier - were killed and dozens were injured in the violence.
At least five soldiers were wounded - two critically - in a fire-fight at the hospital before Mr Correa was removed at top speed in a 4x4 vehicle, according to the military and Red Cross.
Mr Correa was trapped for more than 12 hours in the hospital, where he being treated for the tear-gassing which nearly asphyxiated him when he tried to reason with angry police officers at a capital barracks. The officers also assaulted him and pelted him with water.
At the hospital, Mr Correa vowed to defend his dignity and leave either "as president or as a corpse".
The 47-year-old president, speaking from the balcony of the Carondelet palace after his rescue, told hundreds of cheering backers that it "was the saddest day of my life". He said 27 of his special forces bodyguards had been injured.
Mr Correa thanked the supporters who converged on the hospital "ready to die to defend democracy" - his loyalists hurled stones at police who repelled them with tear gas.
And he said the uprising was not just a pay dispute. "There were lots of infiltrators, dressed as civilians, and we know where they were from," the US-trained leftist economist shouted.
He had blamed his political foes all day, but without naming anyone specifically. His foreign minister Ricardo Patino, however, pointed the finger at former president Lucio Gutierrez, who co-led the 2000 coup which ousted Jamil Mahuad - though Mr Gutierrez described the accusation as "totally false".