Media playback is unsupported on your device Media caption Jonathan Head in Bangkok: "The question is, what will the army do now?"

The Thai military has imposed martial law amid a political crisis "to preserve law and order", but says the surprise move is not a coup.

The move follows months of tension between the government and opposition.

Acting PM Niwatthamrong Boonsongphaisan urged the army to act "under the constitution" and "with no violence", and has asked for new polls in August.

The opposition protesters reject elections and one key leader vowed to continue the anti-government campaign.

'No need to panic'

Correspondents say martial law could enrage supporters of the government, especially if it is seen as amounting to a coup. The army has staged at least 11 coups since the end of the absolute monarchy in 1932.

Soldiers have taken over TV and radio stations, and blocked off roads in the capital, Bangkok.

Army chief Prayuth Chan-Ocha called on rival parties to talk to each other and resolve the political crisis. Martial law would remain in place until "peace and order" had been restored, he told government officials on Tuesday.

Soldiers have moved into the main government building in Bangkok, which has been unoccupied following months of violent demonstrations by opponents who want to be rid of an administration they say is corrupt.

Media playback is unsupported on your device Media caption The coup comes after months of escalating tensions

Image copyright Reuters Image caption The military said it was taking the dramatic step in the interests of law and order

Image copyright Reuters Image caption Some anti-government protesters celebrated the army's move

Image copyright Getty Images Image caption Some even seized the opportunity to have their photo taken with soldiers

The military has also ordered media censorship in the interests of "national security".

Both pro and anti-government protesters have been told not to march anywhere in order to prevent clashes.

Analysis: Jonathan Head, BBC News, Bangkok

The army insists its imposition of martial law does not amount to a coup d'etat, and it is trying to operate with as light a footprint as possible.

At Government House troops were able to retake the building from the anti-government PDRC movement without any fuss, although it is still surrounded by protest tents and stages.

The muted reaction from both sides shows the military's low-key approach is working - for now. Both the government and its red-shirt supporters have accepted the army commander's word, that it is not taking over political power. The PDRC has cancelled rallies planned for Tuesday.

But none of this resolves the intractable political conflict which has afflicted Thailand for eight years. If all the army does is maintain security, the problem will remain unresolved, and governance will be crippled.

If the army tries to impose its own solution though, what at the moment seems like a "half-coup" could well become a complete one, an outcome the red-shirt movement has said it will rise up against and resist.

Martial law was first announced on military-run TV. In its statement, the army stressed that the public need not panic.

The announcement cited a 1914 law that allows the military to intervene during times of crisis.

Thai stocks and the baht currency dropped on Tuesday after the army announcement.

Thailand's martial law act of 1914

Image copyright AFP

Gives the army chief control without PM's assent

Grants the military full powers to:

Summon officials and individuals for investigation Search and seize individuals or items Order compulsory military service and forced labour Prohibit assemblies, media coverage, advertising, public transport Destroy "enemy" dwellings and build army barracks anywhere

The caretaker government earlier said it had not been consulted about the army's decision, but insisted that it remained in office.

An army spokesman also said the imposition of martial law would have no impact on the caretaker government.

Mr Niwatthamrong said on Tuesday that he had asked the Election Commission to organise a poll for 3 August.

But the BBC's Jonah Fisher in Bangkok says that the anti-government demonstrators have made it clear they do not regard elections as a way out of the crisis.

Protest leader Suthep Thaugsuban said in a speech to supporters: "Martial law does not affect our civil uprising... We still retain our right to demonstrate against this tyrannical government."

Power struggle

Image copyright Getty Images Image caption Critics of Ms Yingluck, seen here in Bangkok, say her exiled brother still controls the government

The latest unrest began in the Thai capital late last year, when Ms Yingluck dissolved the lower house of parliament and demonstrators blockaded several areas.

Ms Yingluck called a snap election in February that her party was widely expected to win. But protesters disrupted the voting and it was later annulled.

This month a court ordered Ms Yingluck's removal for alleged abuse of power.

Thailand has faced a power struggle since Ms Yingluck's brother, Thaksin Shinawatra, was ousted by the military as prime minister in 2006.

Since then, there have been periodic anti-government protests which have turned deadly at times.