The move was announced on the military's television channel at 3 am (1:30 IST).
"The Army aims to maintain peace, order and public safety for all groups and all parties," a ticker running on the army's television channel said. The military insisted that its assumption of responsibility for national security was not a coup.
"People are urged not to panic, and can carry on their business as usual. Declaring martial law is not a coup d'etat," it said.
An army spokesman said that the imposition of martial law will have no impact on the caretaker government which remains in office. The announcement also granted the army wide-ranging powers to enforce its decision.
The military statement was signed by army chief Prayuth Chan-Ocha, citing a 1914 law that allows it to intervene during times of crisis.
Martial law comes after a long-running political crisis, and months of escalating tensions between the government and the opposition. Anti-government protesters staged mass protests in recent days to topple the government.
The crisis deepened when a constitutional court removed Yingluck Shinawatra from her position as prime minister for abuse of power along with nine cabinet members.
The country has been without a proper functioning government since December and has failed to draw up a state budget after Yingluck dissolved the lower house of parliament.
The military, which has staged 11 successful coups since the end of absolute monarchy in 1932, also declared that all of the country's radio and television stations must suspend their normal programs "when it is needed."
All Thai TV stations are being guarded by the military, Thai public television announced, showing pictures of soldiers and armoured vehicles taking positions outside broadcast facilities in the country's capital.
An aide to interim Prime Minister Niwattumrong Boonsongpaisan said the government had not been consulted about the army's decision.
"They took this action unilaterally. The government is having a special meeting regarding this," the aide said, describing the situation as "half a coup d'etat".
The dramatic announcements come days after the head of the army issued a stern warning after political violence had surged in the country's capital after poetasters say Yingluck's removal is not enough.
Protesters want to remove the caretaker administration run by ruling Pheu Thai Party and install an unelected council which should carry reforms before elections. But the ruling party want to conduct elections in July.
Niwattumrong, who took over as caretaker prime minister, is from the same ruling party.
Protesters accuse Yingluck of acting as a proxy for her fugitive brother, former premier Thaksin, who was ousted in a coup in 2006. The political unrest in recent months has claimed 28 lives.
The military said that the move to declared martial law had been taken because mass rallies between political rivals "could impact the country's security and safety".