BANGKOK — Thailand’s army chief announced a military takeover of the government Thursday, saying the coup was necessary to restore stability and order after six months of political deadlock and turmoil.

Gen. Prayuth Chan-ocha said in a statement broadcast on national television that the commission that imposed martial law Tuesday would now take control of the country’s administration.

“It is necessary for the Peace and Order Maintaining Command — which includes army, navy, armed forces and police — to take control of governing the country,” Prayuth said, flanked by the heads of the armed forces.

The pivotal development came after Prayuth declared martial law on Tuesday in what he called a bid to resolve the crisis and a day later summoned the country’s rival political leaders for face-to-face talks. Two days of talks failed to break the impasse.

Shortly before the announcement was made, armed soldiers in military vehicles surrounded the military facility where the politicians were meeting, apparently to block those inside from leaving.

Many of the country’s highest-profile figures were summoned for the meeting. They included the acting prime minister — who sent four Cabinet ministers in his place — and anti-government protest leader Suthep Thaugsuban, as well as Suthep’s rival from the pro-government Red Shirt group, Jatuporn Prompan. Reporters at the meeting said Suthep and Jatuporn were escorted out of the meeting by soldiers.

A government official, Paradorn Pattanathabutr, contacted shortly after the announcement said that the four ministers attending the meeting were still being held by the military.

“The rest of us who are outside are still fine and in the safe places. However, the situation is very worrying. We have to monitor it closely and don’t know what else can happen,” he said.

Thailand has been gripped by bouts of political instability for more than seven years.

The latest round of unrest started in November, when demonstrators took to the streets to try to force Prime Minister Yingluck Shinawatra to step down. They accused her of being a proxy for her popular billionaire brother, former Prime Minister Thaksin Shinawatra, who was ousted in a 2006 military coup and now lives in self-imposed exile to avoid a jail sentence on a corruption conviction.

The coup announced Thursday was the 12th since the country’s absolute monarchy ended in 1932. The military was widely viewed as sympathetic to the protesters seeking to oust the current government.

“We ask the public not to panic and to carry on their lives normally,” Prayuth said. “And civil servants stay in every ministry, carry on your responsibilities as normal.”

The army chief said that the military would “provide protection” for foreigners in Thailand.

Prayuth invoked the military’s expanded powers Tuesday and issued more than a dozen edicts that included broad powers of censorship over the media, the Internet and vaguely defined threats to prosecute opponents.

The military had insisted it was not seizing power, but was acting to prevent violence and restore stability in the deeply divided country. But Prayuth provided little clarity on a path forward, amid speculation both at home and abroad that the declaration of martial law was a prelude to a coup.