Updated

Thailand's army declared martial law early Tuesday, claiming that it was doing so to help "preserve law and order" after six months of sometimes violent political unrest.

But the military, which has been granted wide-ranging powers, insists that a coup d'etat is not underway.

The move effectively places the army in charge of public security nationwide. It comes one day after the Southeast Asian country's caretaker prime minister refused to step down and follows six months of anti-government demonstrations that have failed to oust the government.

The army said in a statement it had taken the action to "keep peace and order." But the chief security adviser to the interim prime minister said the government had not been consulted about the army's decision, the BBC reports.

Armed troops entered multiple private television stations in Bangkok to broadcast their message nationwide. Although troops were deployed at some intersections, the vast metropolis of 10 million people appeared calm and commuters could be seen driving and walking to work as usual.

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."

Justice Minister Chaikasem Nitisiri told The Associated Press the army had not consulted the Cabinet. He played down the move, saying 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."

A ticker on Chanel 5, an army station, also denied the military was taking over and asked the public not to panic.

Thailand's army has staged at 11 successful coups since the end of absolute monarchy in 1932. The last was in 2006.

The military statement was signed by army chief Gen. Prayuth Chan-Ocha, who later read it on air. He cited a 1914 law that gives the authority to intervene during times of crisis, and said it had taken the action because on-going mass rallies between political rivals "could impact the country's security and safety of the lives and public property."

The leader of the pro-government Red Shirt movement, Jatuporn Prompan, said his group could accept the imposition of martial law, but said they "won't tolerate a coup or other non-constitutional means" to grab power.

"We will see what the army wants," he said, warning that the undemocratic removal the country's caretaker government "will never solve the country's crisis and will plunge Thailand deeper into trouble."

Red Shirts had been massing for days on the outskirts of Bangkok, and Jutaporn said his supporters were being "surrounded." More than 100 soldiers deployed near the rally venue with coils of barbed wire to block roads; they appeared to be taking over control of the area from police.

On Monday, Thailand's acting prime minister insisted his government will not resign, resisting pressure from a group of senators who are seeking ways to settle the country's political crisis, and from anti-government protesters who are demanding an appointed prime minister.

The deadlock in Southeast Asia's second-largest economy has worsened since former Prime Minister Yingluck Shinawatra dissolved the lower house in December in a bid to ease the crisis. The Constitutional Court ousted her and nine Cabinet ministers earlier this month for abuse of power.

A group of about 70 senators, most of whom are seen as siding with the anti-government protesters, proposed a framework on Friday that calls for a government with full power to conduct political reforms.

Acting Prime Minister Niwattumrong Boonsongpaisan and Nitisiri met with two representatives of the Senate in an undisclosed location Monday to avoid disruption from the protesters.

After the meeting, Niwattumrong said the Cabinet cannot resign because it would be unconstitutional to do so. He insisted he "can carry out duties and has full authority" as prime minister.

The Cabinet has operated in a caretaker capacity with limited power since Yingluck dissolved the lower house in December in a failed bid to ease the political crisis. A new government cannot normally be named until there are elections, which anti-government demonstrators have vowed to block unless political reforms occur first.

The Senate, the only functioning legislative body in the country, was seen as the last resort of the anti-government protesters, who are calling for an interim, unelected prime minister to be chosen.

The protesters say they are making their final push to oust the government and install an unelected prime minister and government. They have promised to call off their rallies if they are not successful by May 26, following six months of street demonstrations in which 28 people have died and hundreds of others have been injured.

An overnight attack last week on the main anti-government protest site left 3 dead and more than 20 injured. It raised the toll since November to 28 dead and drew a strong televised rebuke from the army chief.

"This week looked ominous," said Thitinan Pongsudhirak, director of the Institute of Security and International Studies at Bangkok's Chulalongkorn University. "There was a strong likelihood of violence and turmoil."

"Martial law is intended to impose peace and order, but the key will be the army treatment of the two sides," Thitinan said. "If the army is seen as favoring one side over the other, then we could see the situation spiral and deteriorate. If the army is seen as even-handed ... we could actually see the situation improving."

The protesters on Monday began searching for members of the Cabinet at their residences to pressure them to resign, but did not find any.

Labor unions representing about 20 state-owned enterprises vowed to go on strike Thursday to support the anti-government protesters, although several companies, including Thai Airways and the Electricity Generating Authority of Thailand, said Monday that they would operate normally.

Thailand's political crisis began in 2006, when Yingluck's brother, former Prime Minister Thaksin Shinawatra, was toppled by a military coup after being accused of corruption, abuse of power and disrespect for King Bhumibol Adulyadej.

Thaksin, a former telecommunications billionaire, remains highly popular among the poor in the north and northeast, and parties controlled by him have won every national election since 2001. The anti-government protesters, who are aligned with the opposition Democrat Party and backed by the country's traditional elites, say they want to remove all traces of his political machine from politics.

The Associated Press contributed to this report.