Thailand's army declared martial law on Tuesday to restore order after six months of anti-government protests that have left the country without a proper functioning government, but denied that it was staging a military coup.The caretaker government led by supporters of self-exiled former premier Thaksin Shinawatra was still in office, military officials and the country's justice minister said, following the surprise announcement on television at 3 a.m. (2000 GMT on Monday).Army chief General Prayuth Chan-ocha later said the military was taking charge of public security because of violent protests that had claimed lives and caused damage. Nearly 30 people have been killed since the protests began in November last year."We are concerned this violence could harm the country's security in general. Then, in order to restore law and order to the country, we have declared martial law," Prayuth said."I'm asking all those activist groups to stop all activities and cooperate with us in seeking a way out of this crisis."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. An acting prime minister has since taken over.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.The military, which put down a pro-Thaksin protest movement in 2010, has staged numerous coups since Thailand became a constitutional monarchy in 1932. The last one was in 2006 to oust Thaksin, a billionaire who commands huge support among the rural poor.Army chief Prayuth had warned last week, after three people were killed in a gun and grenade attack on anti-government protesters in Bangkok, that troops might have to be used to restore order if the violence continued.Although the caretaker government's supporters are wary of the army, given its past interventions on the side of the establishment, the acting justice minister said it welcomed the move to keep the peace."It's good that the army is looking after the country's security. However, the government still has full power to run the country," Chaikasem Nitisiri told Reuters.