Breaking News Emails

Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Thailand's army declared martial law nationwide on Tuesday to restore order after six months of street protests that have left the country without a proper functioning government, but denied that the surprise move amounted to a military coup.

The army chief, General Prayuth Chan-ocha, said rival political groups should talk to each other and that the martial law imposed on Tuesday would last until peace and order had been restored.

The army would take action against anyone that used weapons and harmed civilians, he added.

Thai army chief General Prayut Chan-O-Cha gives a traditional greeting as he arrives at the Army Club in Bangkok on Tuesday.PORNCHAI KITTIWONGSAKUL / AFP - Getty Images

While troops patrolled parts of Bangkok, the caretaker government led by supporters of self-exiled former premier Thaksin Shinawatra was still in office, military and government officials said.

Nearly 30 people have been killed since the protests began in November last year.

Both pro- and anti-government protesters are camped out at different places in the capital and, to prevent clashes, the army ordered them to remain where they were and not march anywhere. The army also called on media not to broadcast material that would affect national security and ordered 10 satellite TV channels, including both pro- and anti-government stations, to stop broadcasting.

An army official, speaking on condition of anonymity because of the sensitivity of the situation, told The Associated Press: "This is definitely not a coup. This is only to provide safety to the people and the people can still carry on their lives as normal."

The caretaker government, wary of the army given its past interventions on the side of the establishment, welcomed the move to restore order. It said it had not been informed but it was still running the country.

"The government doesn't have a problem with this and can govern the country as normal," caretaker Justice Minister Chaikasem Nitisiri, told Reuters.

Nitisiri told The Associated Press the caretaker government was still running the country but that the army was now in charge of security. "Security matters will be handled solely by the military, and whether the situation intensifies or is resolved is up to them," he said. "There is no cause to panic. Personally, I welcome the move."

Thai soldiers sit in an army truck outside the Government Public Relations Department in Bangkok after martial law was imposed on Tuesday.CHRISTOPHE ARCHAMBAULT / AFP - Getty Images

An aide said caretaker Prime Minister Niwatthamrong Boonsongphaisan had summoned a government meeting at an undisclosed location to discuss the situation.

Thailand's army has staged 11 coups since the end of absolute monarchy in 1932. Thailand has been stuck in political limbo since Prime Minister Yingluck Shinawatra, Thaksin's younger sister, and nine of her ministers were dismissed on May 7 after a court found them guilty of abuse of power.

The crisis, the latest installment of a near-decade-long power struggle between former telecoms tycoon Thaksin and the royalist establishment, has brought the country to the brink of recession and even raised fears of civil war.

Reuters and The Associated Press