Thailand's army chief general Prayuth Chan-ocha has declared that the military is taking control of the country's government in a coup d'etat.

The military leader said in a televised statement that the army would "restore order and push through political reform" with a 10pm country-wide curfew installed.

The leaders of both the pro-government Red Shirt and People's Democratic Reform Committee (PDRC) factions were detained inside an army club where negotiations between the two were taking place.

General Prayuth is to head a ruling military body - the National Peace and Order Maintaining Council - but the parliament's upper house and courts will continue to function, said a military statement.

Earlier this week, the military declared martial law to restore the security situation and shut down the country's main television stations, divesting the government of its power to maintain peace.

Chan-ocha said the army had been forced to take action after six months of violent protests between opponents and supporters of deposed prime minister Thaksin Shinawatra.

"We are concerned that this violence could harm the country's security in general," he said after declaring martial law.

"In order to restore law and order to the country, we have declared martial law. I'm asking all those activist groups to stop all activities and cooperate with us in seeking a way out of this crisis."

A senior army official said that the military is to deploy troops and vehicles to remove protesters from large anti-government rally sites in Bangkok.

Ongoing unrest

The unrest began after former prime minister Yingluck Shinawatra -- sister of deposed former prime minister Thaksin Shinawatra -- dissolved the lower house of the Thai parliament last year.

The anti-government movement is opposed to the involvement of anyone associated with Yingluck's brother Thaksin who was removed from office in 2006.

An interim prime minister, Niwattumrong Boonsongpaisan, was installed earlier this month after a court ordered Yingluck's removal for abuse of power.

However, the leader of the pro-government Red Shirts -- or Puea Thai party -- Jatuporn Prompan had previously warned that there would be civil war if the government was removed.

"It's fine... our position is the same. If soldiers appoint a prime minister then we will escalate our rally. Stay calm, there has been no coup yet," he said.

The European Union had called for "a clear timetable" for new elections in Thailand before the coup.

"The EU has consistently called for dialogue, a peaceful resolution of the political crisis and respect for democratic principles in Thailand," said Baroness Ashton, the EU's foreign policy chief.

Since the unrest began in December last year, 28 people have been killed.