Abhisit Vejjajiva, Thailand's prime minister, declared a state of emergency in Bangkok today, handing the army broad powers to restore order after anti-government protesters broke into a parliament building.

As a Black Hawk helicopter with five soldiers armed with M-16 rifles flew ministers to safety, other politicians scaled the compound's walls to escape the most chaotic protest occurring in several weeks of demonstrations.

The protesters want Abhisit to dissolve the government and call elections within 15 days.

In a televised statement, Abhisit said: "The government has tried its best to enforce the law, but violations of the law have increased. Our main goal is to bring the country back to normal and make our law sacred once again."

Arisman Pongruengrong, one of the most radical of the protest leaders, today led the group that rushed inside parliament while the deputy prime minister, Suthep Thaugsuban, and other lawmakers were inside. But the group later withdrew from the building at the request of opposition legislators.

Abhisit has offered to call elections by the end of the year. Today he did not spell out how the emergency decree would be applied but the government has already put Bangkok under an internal security act.

A state of emergency will include more sweeping powers, allowing the military to restore order and the government to impose curfews, ban public gatherings of more than five people, and censor and ban media from disseminating news that "causes panic". It will also allow security officials to detain suspects without charge for up to 30 days.

The Red Shirt protesters, who contend Abhisit came to power illegitimately, have been camped in Bangkok since 12 March. The movement, known as the United Front for Democracy Against Dictatorship, includes supporters of the former prime minister Thaksin Shinawatra who opposed the 2006 coup that ousted him.

Leaders of the current protest claim to be waging a class war, saying the country's traditional elite, including the Oxford-educated Abhisit, is impervious to the plight of the largely rural, impoverished majority. The most striking aspect of the rift could be the sense of empowerment growing among the poor.

Red Shirt leaders responded to the emergency decree by telling protesters to stay put and wait for the military to arrive. They have called a rally for Friday.

Abhisit has been harshly criticised by business people and Bangkok's middle-class for failing to take strong measures to end the protests.