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.
qUWmFPQ0SJsImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…