Rafael Correa was trapped inside a hospital during a police revolt over austerity measures. South American leaders met to condemn the rebellion Reuters

Ecuador remained in a state of siege tonight with the military in charge of public order and President Rafael Correa promising to punish his enemies a day after a police rebellion triggered mayhem.

Charred tyres, debris and the whiff of teargas lingered in the capital, Quito, and other cities that bore the brunt of Thursday's anarchy, leaving a polarised country nervous and uncertain about the political and economic repercussions.

Correa emerged triumphant from the uprising and vowed to "purge" those responsible for protests that left him battered, shut down the airport and motorways and shook the institutions of state.

The leftist president said there would be "no pardon or forgiveness" for those involved and promised "a deep cleansing of the national police".

He suggested the axe would also swing towards opposition politicians whom he accused of attempting a coup, setting the scene for further political turmoil.

The first head to roll was that of Freddy Martinez, the national police chief, who resigned with immediate effect today. He was not implicated in the revolt but failed to anticipate or quell it.

A crisis team including the ministers of defence, security and the interior were meeting last night at Carondelet Palace to chart a course through the aftermath of a protest which caused Peru and Colombia to shut their borders with Ecuador and nudged up the global price of oil.

The hundreds of police and rogue military units who had stormed the airport and national assembly and besieged the president in a hospital had melted away today. The rebels were angered by a new law which they said would hit their bonuses and benefits – a claim denied by the government.

Quito residents were divided over whom to blame for the mayhem. Carlos Gallardo, 51, a bookkeeper, said Correa's political foes had stirred trouble by manipulating police and military grievances over pay and conditions.

But Maria Silva, 64, a maid, faulted Correa for fanning the protest by challenging police at a base. "This wasn't a coup, it was a protest, but it was the president's fault for going there."

Correa, his voice hoarse from addressing rallies, kept the political temperature high in media interviews from the palace. "There were lots of infiltrators, dressed as civilians, and we know where they were from. They wanted deaths, they wanted blood."

Both he and the foreign minister, Ricardo Patino, pointed the finger at the former president Lucio Gutierrez. Patino said insurgent police had shouted "Viva Lucio!" – "Long live Lucio!" – in the tense moments of confrontation with Correa.

The president told supporters after his rescue that "the people of Lucio Gutierrez were there, provoking, inciting to violence." In a TV interview, Gutierrez called that accusation "totally false".

Latin American leaders from across the political spectrum united in support of Correa, as did the US and the UN secretary general, Ban Ki-moon. Venezuela's president, Hugo Chávez, backed his ally's contention that the unrest was a coup attempt. Doris Solis, an Ecuadorian cabinet minister, disagreed. "This is not a coup," she told CNN.

The head of the armed forces, Ernesto Gonzalez, said troops remained loyal to Correa. "We are in a state of law. We are loyal to the maximum authority, which is the president."

Even before the protests, the government's proposed austerity measures had triggered a political crisis and revolt by the president's own party, the Country Alliance. Correa threatened to dissolve parliament and rule by decree until elections. Correa, who has a Belgian wife, was elected in 2006 promising a "citizens' revolution" to spread the benefits of oil, gas and other revenues to the poor in the Andean mountains, Amazon forests and Pacific coast slums.

He defaulted on a $2.8bn debt, calling it illegitimate, and boosted spending on education and health.

He was re-elected under the new constitution last year but public sector workers and indigenous groups, among others, have accused him of breaking promises.The president went to a regimental barracks to try to negotiate with protesters but was surrounded, punched, doused with hot water and almost blinded with teargas.

A government helicopter tried to evacuate him but was unable to land. The president was spirited to a hospital but police rebels laid siege, prompting a raid by army loyalists who rescued the president during a 35-minute gun battle.

Two people died in the clashes, according to the Red Cross, and at least 88 people were injured in unrest throughout the country.