Citing a worsening security situation, Thailand's army chief general Prayuth Chan-ocha has declared martial law in Thailand starting at 3am local time this morning.

According to the army's order, martial law has been applied throughout the country. As dawn broke over Bangkok, troops were swiftly deployed at several TV stations. Until 6am there was no news of any arrests.

Martial law which puts security in the hands of the army with sweeping powers to detain people, does not amount to a coup d'etat, but is likely to be seen as such by the pro-government camp - unless any crackdowns are even handed and target both pro- and anti-government camps.

But with shadowy armed elements on both sides, Thailand faces great uncertainty.

The measure comes as Thailand's six month political stalemate continues, with analysts warning that the situation could worsen into a civil war. More than 20 people have been killed and hundreds injured in clashes since the current round of crisis began.

Thailand has had no sitting parliament since December last year, and elections on February 2 failed in the face of sabotage by the anti-government People's Democratic Reform Committee (PDRC). With the economy slowing as tourists stay away and consumer confidence vanishes, Thailand is on the brink of a recession.

Rival political camps have massed in Bangkok, with pro-government ''red shirts'' incensed at the ouster on May 7 of former premier Yingluck Shinawatra gathered - thus far unarmed and peaceful - in thousands at the western edge of the city.

The royalist PDRC's main target is Ms Yingluck's brother Thaksin Shinawatra, the billionaire ex premier who has been in self-exile since 2008 dodging a two year abuse of power jail term.

The PDRC which draws its backing largely from Bangkok's royalist upper middle class elites, has been holding prolonged rallies in downtown Bangkok and has also virtually taken over Government House - normally the office of the prime minister.

PDRC leader Suthep Thaugsuban, a veteran politician, has given May 26 as the deadline for the government to be removed. The movement sees Thaksin as a corrupt closet Republican bent on controlling Thailand at the expense of the monarchy.

Thaksin's ''red shirt'' supporters draw their strength mainly from the populous north and north east, and are incensed at what they see as the royalist elites repeatedly moving against him and his proxy parties which have been winning elections since 2001. They see Mr Suthep as a front for royalist elites determined to wipe out Thaksin's political network.