The surprise announcement also granted the army wide-ranging powers to enforce its decision.
The military insisted that its assumption of responsibility for national security was not a coup.
Martial law comes amid a long-running political crisis, and months of escalating tensions between the government and the opposition.
Correspondents say the move 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.
Roads in the capital, Bangkok, have been blocked off by tanks.
The military has taken over TV and radio stations, and ordered media censorship in the interests of “national security”.
Soldiers have also moved into the main government building, which has been unoccupied following months of violent demonstrations by opponents who want to be rid of an administration they say is corrupt.
Both pro and anti-government protesters have been told not to march anywhere in order to prevent clashes.
An announcement on military-run TV said martial law had been imposed “to restore peace and order for people from all sides”.
“The public do not need to panic but can still live their lives as normal,” it said.
The military statement was signed by army chief Prayuth Chan-Ocha, citing a 1914 law that allows it to intervene during times of crisis.
The chief security advisor to the interim prime minister said the government had not been consulted about the army’s decision, but says it remains in office.
“Everything is normal except the military is responsible for all national security issues,” said Paradorn Pattanatabut.
An army spokesman also insisted the imposition of martial law would have no impact on the caretaker government.
Observers say the deadlock in south-east Asia’s second-largest economy has got worse since Yingluck Shinawatra dissolved the lower house of parliament in December, and a court ordered her removal earlier this month for abuse of power.
On Monday, acting PM Niwatthamrong Boonsongphaisan insisted his government would not resign, resisting pressure from anti-government protesters.
qUWmFPQ0SJsAt least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…
India and Canada have decided to expel their top envoys along with other diplomats as…