Ecuador's government has declared a state of emergency after police launched a chaotic rebellion over austerity measures that cut their benefits.

Incensed officers shoved President Rafael Correa around and pelted him with tear gas and water when he tried to speak at a police barracks in the capital. Correa, 47, was taken to hospital from the effects of the gas.

The state of emergency puts the military in charge of public order, suspending civil liberties and allowing soldiers to carry out searches without a warrant.

Hundreds of officers involved in the insurrection took over police barracks in Quito, Guayaquil and other cities. They also set up roadblocks out of burning tires that cut off highway access to the capital.

Scores of uniformed men overran the landing strip at Quito's main airport, forcing flights to be cancelled

Correa challenged the protesters to kill him, according to local media. "I'm not taking one step back. Gentleman, if you want to kill the president, here he is, kill him if you have the guts." The rebel officers responded with shouts, stones and teargas canisters, prompting Correa's bodyguards to spirit him from the scene.

The protests rapidly spread to bases and barracks in three provinces, with witnesses reporting looting, compounding a political crisis that could prompt the president to dissolve parliament and rule by decree until elections.

There was no indication that Correa faced assassination, nor that the government would fall. 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."

The foreign minister, Ricardo Patino, played down the severity of the protests. "This is not a popular mobilisation, it is not a popular uprising, it is an uprising by the police, who are ill-informed," he told TV network Telesur. The central bank chief, Diego Borja, called for calm.

Ecuador has a tradition of protests but to see about 150 mutinous members of the air force swarm through Quito's Mariscal Sucre international airport was a first.

The action was followed by hundreds of soldiers and police in Quito and the commercial capital, Guayaquil, who blocked roads, lit tyres and fired teargas. "Respect our rights!" some shouted. "Long civil war!" shouted others.

There were no immediate reports of casualties and the president showed no sign of backing down. "They are a bunch of ungrateful bandits. No one has supported the police as much as this government," he told reporters.

The protests were triggered by a law passed by congress yesterday on Wednesday that would end the practice of giving medals and bonuses with each promotion. It would also extend from five to seven years the usual period required for promotions. The law needs to be published before it takes effect.

Correa is a US-trained economist who has tried to slim Ecuador's bureaucracy. His own party, the Country Alliance, opposed the austerity measures, prompting his threat to dissolve congress.

The two-year-old constitution allows the president to declare a political impasse and dissolve the assembly until a presidential and parliamentary election. The measure needs constitutional court approval. "This is a scenario that nobody would want, but it is a possibility when the conditions for change do not exist," said Doris Solis, a minister.

Correa, who has a Belgian wife, was elected in 2006 promising a "citizens' revolution" to spread benefits of oil, gas and other revenues to the poor in Andean mountains, Amazon forests and Pacific coast slums. He defaulted on a $2.8bn (£1.8bn) debt, calling it illegitimate, and boosted spending on education and health.

He was re-elected under the new constition last year but since then public sector workers and indigenous groups, among others, have accused him of breaking promises.