Ecuadorean President Rafael Correa has accused the protesters who cornered him in a hospital of staging a coup attempt.
Police demonstrators attacked the leftist leader in an eruption of political unrest over austerity measures.
Some of the president's supporters hurled stones at police around the building and the officers fired teargas back.
Venezuela's President Hugo Chavez, Mr Correa's main regional ally, said his friend told him by phone that police chiefs were making demands of him at the hospital.
"He told them that once he had left he would be very happy to receive them, but that they had kidnapped him, and he would not give in to blackmail," Chavez said on Venezuelan state TV. He said Correa's life was in danger and he urged the Ecuadorean military not to support the attempted "coup".
Ecuador, a South American OPEC member of some 14 million people, has a long history of political instability. Street protests toppled three presidents during economic turmoil in the decade before Correa took power.