Thailand's Prime Minister Prayuth Chan-ocha arrives to a weekly cabinet meeting, at Government House in Bangkok, Thailand, June 4, 2019.
Bangkok, Thailand CNN  — 

The former head of Thailand’s military junta has been formally elected as the country’s next prime minister by members of the lower and upper houses of Parliament, consolidating the military’s grip on power following national elections in March.

Prayut Chan-o-cha, who installed himself as Thailand’s leader following a coup in 2014, beat the popular billionaire leader of the anti-junta Future Forward Party, Thanathorn Juangroongruangkit, with 500 votes to 244 after a 12-hour session that included 10 hours of fierce debate in Parliament Wednesday night.

The 40-year-old Thanathorn, who had seen his popularity soar among many of Thailand’s young voters, was nominated as the pro-democracy camp’s choice for prime minister.

Prayut will now head a coalition government led by the pro-military Palang Pracharat Party.

In a press conference following the vote, Thanathorn apologized to his supporters, “we couldn’t achieve our mission that we couldn’t stop NCPO (National Council for Peace and Order)” he said, referring to the formal name of the military junta. “This lost wasn’t unexpected.”

Wednesday’s vote follows a confusing end to Thailand’s first post-coup poll, which took place on March 24.

The announcement of final results was delayed and no party took a decisive lead though both leading parties – Pheu Thai and Palang Pracharat – claimed the right to form a coalition.

The contest was also dogged by allegations of voting irregularities, leading one non-governmental watchdog to determine that the election was “not free and fair.”

Shortly after the vote, the main opposition Pheu Thai party – which is aligned with former Prime Minister Thaksin Shinawatra, whose allies were ousted before the coup – and six other parties announced they had forged a coalition accounting for 255 seats in the 500-member lower house of parliament.

Their aim to block the military’s return to power ultimately failed as Prayut was able to rely on the military-appointed 250-member Senate to secure enough votes.

Among those Senate members are 101 police and military generals, Prayut’s younger brother, a brother of the Deputy Prime Minister and Defense Minister Gen. Prawit Wongsuwan, and an elder brother of Deputy Prime Minister Somkit Jatusripitak.

Before the parliamentary session convened, former Democrat Party leader and former Prime Minister Abhisit Vejjajiva resigned his seat in the House of Representatives in protest of his party’s decision to support Prayut.

Future Forward Party leader Thanathorn Juangroongruangkit  before the parliamentary vote for Thailands new prime minister in Bangkok in June 5, 2019.

While supporters say Prayut will bring stability to a volatile political climate, democracy activists say his five years in power was marked with increased repression and they fear his appointment to the role of prime minister will give him the mandate to continue on that path.

“I think they will continue to do as they have over the past five years with legitimacy,” said Nuttaa Mahattana, a prominent pro-democracy activist. “I think violations of human rights and media freedoms will continue.”

On Wednesday, Human Rights Watch called on Thai authorities to investigate assaults on three leading pro-democracy activists since May 2019.

Sirawith “New” Seritiwat was reportedly attacked by five unidentified men on motorcycles while waiting at a bus stop in Bangkok on June 2. The rights group said Sirawith was collecting signatures for a petition urging senators not to support Prayut for another term in office.

“Violence by thugs against pro-democracy activists has become a dangerous new trend in Thailand,” said Brad Adams, Human Rights Watch’s Asia director. “The failure of Thai authorities to seriously investigate these assaults both encourages future attacks and suggests a possible role by officials.”

Nuttaa said she and many of her peers have faced harassment for their activities and worry what another Prayut regime will bring.

“We have many cases in court, with Prayut as prime minister maybe we will end up in jail,” she said.