Ecuador army frees President Correa from hospital siege
Ecuador's President Rafael Correa has been rescued from a hospital in the capital, Quito, where he had been trapped for several hours in an uprising by disaffected police.
Widespread gunfire was heard as the army moved in to free the president, who was there for treatment after being attacked by police with tear gas.
Mr Correa went on to address supporters outside the presidential palace.
Two people died and dozens were injured in the unrest, officials said.
The president and his supporters said the police revolt over a new law cutting benefits for public servants amounted to an an attempted coup.
Mr Correa, a 47-year-old US-trained economist, took power in 2007 and was elected for a second term in 2009, despite a decision to default on $3.2bn of global bonds causing widespread fiscal problems for the government.
'Kill the president'
Mr Correa had been holed up in the police hospital, where he was treated after being hit by tear gas in a confrontation.
Hundreds of police, angry over a law that would cut their benefits, appeared to have prevented him from leaving the clinic.
Under cover of darkness Mr Correa was reportedly smuggled out of the hospital in a wheelchair as a gun battle between troops and police raged.
Speaking to his supporters outside the presidential palace, Mr Correa said he hoped the events of the day would serve "as an example to those who want to bring a change and stop the citizens' revolution without going through the polls".
"I give so much thanks to those heroes who accompanied me through this hard journey," the Reuters news agency reported him saying.
"Despite the danger, being surrounded, ministers and politicians came, to die if necessary. With that bravery, with that loyalty, nothing can defeat us."
The commander of Ecuador's police force has resigned, a police spokesman said on Friday.
The drama began on Thursday morning when members of the armed forces and police angry at the austerity measures occupied several barracks and set up road blocks across the country.
TV stations showed images of police setting tyres on fire in the streets of Quito, Guayaquil and other cities. The National Assembly building was also occupied.
Police also took control of Quito's international airport for several hours.
Looting was reported in the capital and Ecuador's largest city, Guayaquil. Banks were robbed and schools and businesses closed.
Peru and Colombia closed their borders with Ecuador in solidarity.
In an emotional speech to soldiers from Quito's main barracks, President Correa tore at his shirt and said: "If you want to kill the president, here he is. Kill him, if you want to. Kill him if you are brave enough."
Moments later he was forced to flee the barracks wearing a gas mask when tear gas was fired by the protesters, and he was taken to hospital.
During the day Mr Correa received strong support from governments throughout the Americas, with a string of Latin American nations and the US all speaking up for the embattled president.
Within hours of the violence erupting in Ecuador, the South American regional body, Unasur, called an emergency meeting.
Mr Correa has blamed the Patriotic Society Party (PSP), led by Lucio Gutierrez, for fomenting the unrest, and said "bad elements" in the police force would "be removed".
On Wednesday, one minister had said the president was considering disbanding Congress because members of his Country Alliance had threatened to block proposals to shrink the bureaucracy.
Ecuador's two-year-old constitution allows the president to declare an impasse and rule by decree until new elections. However, such a move would have to be approved by the Constitutional Court.
The BBC's Will Grant, in Venezuela, says Mr Correa could still choose to rule by decree in an effort to stay in control in the immediate future.