Thailand's army declared martial law on Tuesday to restore order after six months of anti-government protests which have left the country without a proper functioning government, but the move did not constitute a coup, military officials said.

The caretaker government was still in office, said deputy army spokesman Colonel Winthai Suvari, following the surprise announcement on television at 3 a.m. (2000 GMT Monday).

"This martial law is just to restore peace and stability, it has nothing to do with the government. The government is still functioning as normal," Winthai told Reuters.

Read MoreThailand's growth outlook goes under the knife



Thailand has been stuck in political limbo since Prime Minister Yingluck Shinawatra and nine of her ministers were dismissed on May 7 after a court found them guilty of abuse of power. An acting prime minister has since taken over.

The crisis, the latest installment of a near-decade-long power struggle between ousted former prime minister Thaksin Shinawatra, Yingluck's brother, and the royalist establishment, has brought the country to the brink of recession.

The military, which put down a protest movement in 2010, has staged numerous coups since Thailand became a constitutional monarchy in 1932, the last one in 2006 to oust the former telecommunications tycoon Thaksin.

Read MoreIs political violence in Thailand set to spiral?

A senior U.S. official said last week the United States was "reasonably confident" the military in close ally Thailand would exercise restraint and not intervene in the crisis.