A state of emergency has been declared in Ecuador after President Rafael Correa accused the opposition and security forces of a coup attempt.
Mr Correa was hit by tear gas after a confrontation and taken to hospital, before violence flared amid reports he was trapped inside.
Gunfire broke out after dark as soldiers launched a reported rescue.
Unrest has been reported across Ecuador amid anger at a new law cutting benefits for public servants.
Supporters said security forces were not allowing the president to leave the police hospital, where he went for treatment after being hit by teargas.
The minister responsible for security, Miguel Carvajal, said at least one person was killed and several others were injured during the unrest, but this could not be immediately confirmed.
Mr Correa has 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.
In other developments on Thursday:
- Police officers erect road blocks in Quito, Guayaquil and Cuenca. Several government buildings are occupied
- Looting is reported in the capital and Guayaquil. Banks are robbed, while schools and businesses close due to the lack of security
- The head of the armed forces declares its loyalty to the president
- Venezuela's president claims Mr Correa is "in danger of being killed"
- Peru and Colombia close their borders with Ecuador in solidarity.
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.
In a speech to soldiers from Quito's main barracks, President Correa said: "If you want to kill the president, here he is. Kill him, if you want to. Kill him if you are brave enough.
"If you want to seize the barracks, if you want to leave citizens undefended, if you want to betray the mission of the police force, go ahead. But this government will do what has to be done. This president will not take a step back."
However, Mr Correa was forced to flee the barracks wearing a gas mask shortly afterwards when tear gas was fired by the protesters.
The president was later treated for the effects of the gas at a police hospital, from where he told local media that he had been "attacked".
"They threw tear gas at us. One exploded near my face. It stunned me and my wife for a few seconds, probably minutes," he said. "I had to put on a gas mask and some cowards took it off me so I would suffocate.
"I mean they shot at the president - it's incredible - our security forces, our national police."
"It is a coup attempt led by the opposition and certain sections of the armed forces and the police," he added. "Whatever happens to me I want to express my love for my family and my homeland."
He blamed the Patriotic Society Party (PSP), led by Lucio Gutierrez, for fomenting the unrest, and said "all bad elements" in the police force would "be removed".
Venezuelan President Hugo Chavez later reported that Mr Correa had told him by telephone from the hospital "that once he had left he would be very happy to receive [the protesters], but that they had kidnapped him, and he would not give in to blackmail".
"They are trying to oust President Correa. Wake up the people of the Bolivarian Alliance! Wake up the people of Unasur [Union of South American Nations]! Viva Correa!," Mr Chavez wrote in a message on Twitter.
Police later fired tear gas at supporters of the president who tried to break up their protest at the hospital, witnesses said.
Meanwhile, about 300 air force personnel and soldiers took control of the runway at Quito's Mariscal Sucre International Airport, causing flights to be grounded. The airport later re-opened, the mayor of Quito told reporters.
The protesters were carrying signs demanding the government give more respect to the military over benefits, witnesses said.
The US embassy said Guayaquil's airport was also closed and warned US citizens to "stay in their homes or current location, if safe".
Despite the unrest, the head of Armed Forces Joint Command, Gen Luis Ernesto Gonzalez Villarreal, said the troops remained loyal.
"We live in a state which is governed by laws, and we are subordinate to the highest authority which is the president of the republic," he said.
"We will take whatever appropriate action the government decides on."
The country's central bank chief, Diego Borja, meanwhile urged its citizens not to withdraw money from banks amid reports of looting. Many schools and business were also closed because of the unrest.
A BBC News website reader in Guayaquil, Andrea M, said: "Thieves have taken advantage of this situation, and started attacking people in the streets. Now, most people are at their homes, waiting to see what happens with the government."
Several leaders in the region expressed their support for Mr Correa, as did the Organisation of American States (OAS). Its Secretary-General Miguel Insulza called the situation "a coup d'etat in the making".
Peru and Colombia both closed borders with Ecuador, while the US said it backed Mr Correa and was "closely monitoring" the situation. UN Secretary General Ban Ki-moon said he was deeply concerned for the president and called for a peaceful resolution to the crisis.
On Wednesday, one minister said President Correa 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 declare an impasse and rule by decree until new elections. However, such a move would have to be approved by the Constitutional Court.
Ecuador has a history of political instability. Protests toppled three presidents during economic turmoil in the decade before Mr Correa, a 47-year-old US-trained economist, took power in 2007.
He was re-elected to a second term in 2009 despite a decision to default on $3.2bn of global bonds causing widespread fiscal problems for the government. Mr Correa declared the debt "illegitimate".