Thailand's military on Thursday carried out the country's 12th coup in 82 years, arresting government and protest leaders in a move the army chief said would end six months of turmoil and deadly protests.

Gen. Prayuth Chan-ocha, flanked by uniformed security officers, announced on state television that the military "needs to seize control of the situation in the country." The constitution that was written after the last coup, in 2006, was being discarded, he said.

Soldiers broke up the main camps of rival protest groups and imposed a nationwide 10 p.m. curfew that sent people in Bangkok, the capital, streaming home aboard the city's crammed public transit systems. As the curfew hour struck, armored personnel carriers were seen blocking some key arteries in the teeming city.

Many Thais greeted the coup stoically, stocking up on provisions before heading home. TV and radio channels were ordered to cease regular programming and soldiers entered some newspaper offices in Bangkok, according to photos posted on social media.

The bloodless takeover marked the second time in eight years that Thailand's army has removed from power the Pheu Thai party, which is linked to Thaksin Shinawatra, the controversial telecommunications tycoon and former prime minister who was ousted in 2006.

Thailand's military seized power on May 22 in a bloodless coup, dissolving the government, suspending the constitution and dispersing groups of protesters from both sides of the country's political divide.

Thailand's military seized power on May 22 in a bloodless coup, dissolving the government, suspending the constitution and dispersing groups of protesters from both sides of the country's political divide.

The Southeast Asian kingdom has been sharply divided between Thaksin's mostly provincial supporters, who have prevailed in recent elections, and the more affluent urban establishment, which wants to temporarily suspend democracy to have his family banished from politics.

Tension has risen over the last six months, with dueling and occasionally violent street protests that resulted in at least 28 deaths.

With the rival camps believed to be headed toward a major confrontation, the army on Tuesday announced that it was imposing martial law across the country, but it denied that it was staging a coup. Military authorities opened talks between government officials and protest leaders at the Army Club in Bangkok.

Seizing power like this is counterproductive and will lead to a lot of problems for the military. I'm not sure they are prepared for it.— Thitinan Pongsudhirak, director of the Institute of Security and International Studies at Chulalongkorn University

After barely 48 hours, however, Prayuth reappeared on television to declare that the military takeover was complete. Military leaders offered no immediate timetable for restoring civilian rule.

One government official, who was not authorized to be quoted by name, described the talks as chaotic and fruitless.

U.S. Secretary of State John F. Kerry said there was "no justification" for the coup and urged the military — a Washington ally dating to the Vietnam War — to restore democracy immediately. U.S. law prohibits direct assistance to countries after a military coup, and Kerry said in a statement that the U.S. was reviewing its annual aid package for Thailand, which includes $12 million for military and civilian programs.

"While we value our long friendship with the Thai people, this act will have negative implications for the U.S.-Thai relationship, especially for our relationship with the Thai military," he said.

Human rights groups sharply criticized the military takeover and questioned why the talks weren't given more time. Critics said the army had taken the side of antigovernment protesters, who have been hoping for military intervention to forestall elections scheduled for the summer, which the Pheu Thai party was expected to win.

"The antigovernment protesters knew they can't compete in the game of democratic politics," said Pavin Chachavalpongpun, a former Thai diplomat who is a professor at the Center for Southeast Asian Studies at Japan's Kyoto University. "They have been successful in creating a situation of ungovernability, where the military had to step in."

In 2010, Prayuth launched a crackdown against the Pheu Thai-aligned "Red Shirt" movement that left more than 80 people dead. The movement's calls for democratic reforms have led to accusations that it is anti-monarchist, a dangerous charge in Thailand, where severe laws prohibit any criticism of the long-ruling king, 86-year-old Bhumibol Adulyadej.

In his statement Thursday, Prayuth said the military would "protect and worship the monarchy."

The coup capped a tumultuous month that saw Thaksin's sister, Yingluck, who was serving as prime minister in a caretaker government, removed from office by the Constitutional Court in an abuse-of-power case. Several of her ministers also were ousted, fueling demands by antigovernment protesters that the administration be dissolved and replaced with an unelected council.

The antigovernment "Yellow Shirt" movement had vowed to dislodge the Pheu Thai government by the end of the month, but Yingluck's successor, acting Prime Minister Niwatthamrong Boonsongpaisan, refused to step down. He did not attend Thursday's negotiations and was believed to be under house arrest.

Analysts predicted that the military would soon install an interim government that would pave the way for new elections, perhaps with restrictions aimed at limiting the influence of Pheu Thai supporters. That probably would send Red Shirt protesters into the streets again, perhaps in a repeat of the violent demonstrations that followed a 1991 coup.

"We can expect some opposition and resistance to the military-inspired government, and we would have a repeat of protests like in the recent past, but probably a lot worse," said Thitinan Pongsudhirak, director of the Institute of Security and International Studies at Chulalongkorn University in Bangkok.

"The stakes are a lot higher. There are a lot more grievances on both sides. Seizing power like this is counterproductive and will lead to a lot of problems for the military. I'm not sure they are prepared for it. It's a great underestimation on their part of what they are up against."