* Army chief says takeover needed to restore order
* Had urged rivals to agree compromise solution
* Interim PM had said caretaker government would not step down
* Both sides stuck to positions in first round of talks
Prayuth made the announcement in a television broadcast after he held a meeting with all rival factions aimed at finding a solution to six months of anti-government protests.
"In order for the situation to return to normal quickly and for society to love and be at peace again ... and to reform the structure of the political, economic and social structure, the military needs to take control of power," Prayuth said in the televised announcement.
The broadcast came shortly after soldiers took the leader of anti-government protests, Suthep Thaugsuban, out of the meeting that was aimed at finding a solution to a drawn-out power struggle that has polarised the country and battered its economy.
The crisis is the latest instalment in a long battle between supporters of ousted former Prime Minister Thaksin Shinawatra and opponents backed by the royalist establishment.
The army had declared martial law on Tuesday, saying the measure was necessary to prevent violence, but it rejected accusations the measure amounted to a coup.
CALL FOR COMPROMISE
Prayuth had called on the two sides in a first round of talks on Wednesday to agree on a compromise that would have hinged around the appointment of an interim prime minister, political reforms and the timing of an election.
Wednesday's talks ended inconclusively with neither side backing down from their entrenched positions, participants said.
The army had let rival protesters remain on the streets but it banned them from marching to prevent clashes. It has also clamped down on the media, including partisan television channels, and warned people not to spread inflammatory material on social media.
After the coup announcement, a senior army official said troops would escort protests away from their rally sites.
Leaders of the ruling Puea Thai Party and the opposition Democrat Party, the Senate leader and the five-member Election Commission had joined the second round of talks at an army base in Bangkok.
Acting Prime Minister Niwatthamrong Boonsongphaisan told reporters before the talks that his government could not resign as its enemies were demanding as that would contravene the constitution.
"The government wants the problem solved in a democratic way which includes a government that comes from elections," he said.
Government officials were not available for comment after the coup announcement.
Former telecommunications tycoon Thaksin has lived in self-exile since 2008 to avoid a jail term for graft, but still commands the loyalty of legions of rural and urban poor and exerts a huge influence over politics, most recently through a government run by his sister, Yingluck Shinawatra.
Yingluck was forced to step down as premier by a court two weeks ago, but her caretaker government remains nominally in power, despite the declaration of martial law and six months of sometimes violent protests aimed at ousting it.
Thailand's gross domestic product contracted 2.1 percent in January-March from the previous three months, largely because of the unrest, adding to fears it is stumbling into recession.
The protesters say Thaksin is a corrupt crony capitalist who commandeered Thailand's fragile democracy, using taxpayers' money to buy votes with populist giveaways.
They wanted a "neutral" interim prime minister to oversee electoral reforms aimed at ridding the country of the Shinawatra family's political influence before any new vote.
The government and its supporters said a general election that it would likely win was the best way forward and it had proposed polls on Aug. 3, to be followed by reforms.
Earlier on Thursday, anti-government protest leader Suthep, a former deputy prime minister in a government run by the pro-establishment Democrat Party, told his supporters victory was imminent.
Thaksin's red shirt loyalists, rallying in Bangkok's outskirts, had warned of violence if the caretaker government is thrown out.
Twenty-eight people have been killed and 700 injured since this latest chapter in the power struggle between Thaksin and the royalist elite flared up late last year.