Ecuador's president Rafael Correa has emerged triumphant after a military raid to rescue him from protesting police, but still faces a political fight to push through austerity measures testing his popularity.
Troops stormed a hospital in the capital Quito late on Thursday and freed the 47-year-old leftist leader from dissident police who attacked him during a demonstration over bonus cuts, forcing him to seek refuge in the building for hours.
Mr Correa accused rivals of trying to topple him in a coup. However, he was buoyed by his return at the end of a day of turmoil that brought many messages of support from the United States to Cuba, Reuters reports.
The United Nations and governments across the Americas have also thrown their support behind Mr Correa.
"I give so much thanks to those heroes who accompanied me through this hard journey," Mr Correa told cheering supporters from the balcony of his presidential palace.
"Despite the danger, being surrounded, ministers and politicians came, to die if necessary. With that bravery, with that loyalty, nothing can defeat us."
The local Red Cross said two police died as troops stormed the building. At least 88 people were injured on Thursday as Correa supporters fought with police outside the hospital. There was some unrest in other cities also.
Ecuador has a history of coups and instability. Street protests toppled three presidents during economic turmoil before Mr Correa took power.
Mr Correa, an American-trained economist and ally of Venezuela's Hugo Chavez, took office in 2007 and alienated international investors a year later when his government defaulted on $US3.2 billion in global bonds.
However, he won strong public approval for policies such as exerting greater state control over natural resources, including forging new contracts with foreign oil firms.
His efforts to cut back spending made him enemies, however, including some of the rank and file in the security forces.