The incumbent prime minister of Thailand’s ruling military junta appears set to cling on to the reins of power despite a pro-democracy opposition party winning the most seats in the country’s March general election.

Final election results released late on Wednesday evening – six weeks after the vote itself – confirmed that the opposition Pheu Thai party won 136 seats in the 500-member lower house, beating the pro-military proxy party of the junta on 97 seats.

However, due to the way Thailand’s electoral system has been skewed in favour of the junta by a new military-drafted constitution, the 2014 coup leader general Prayuth Chan-ocha is expected to win a vote to be named prime minister for a second term.

Thailand’s first election in eight years was billed as a triumphant return of democracy to the country. But allegations of systemic rigging, vote irregularities, questionable rulings by the military-appointed election commission and a lengthy delay in announcing final tallies mean the results are likely to face a string of legal challenges.

Part of the delay in announcing the final results has been due to confusion about the last 150 of the 500 lower house seats, which are awarded proportionately by the election commission based on each party’s total of the nationwide popular vote.

Coronation of Thailand King Maha Vajiralongkorn: In pictures Show all 9 1 /9 Coronation of Thailand King Maha Vajiralongkorn: In pictures Coronation of Thailand King Maha Vajiralongkorn: In pictures Thai royal guards attend the coronation ceremony of Thai King Maha Vajiralongkorn Bodindradebayavarangkun outside the Grand Palace in Bangkok, Thailand EPA Coronation of Thailand King Maha Vajiralongkorn: In pictures Thai royal guards fire an artillery gun salute during the coronation ceremony of Thai King Maha Vajiralongkorn Bodindradebayavarangkun outside the Grand Palace in Bangkok, Thailand EPA Coronation of Thailand King Maha Vajiralongkorn: In pictures Thailand's King Maha Vajiralongkorn is crowned during his coronation in Bangkok in this still image taken from TV footage REUTERS Coronation of Thailand King Maha Vajiralongkorn: In pictures This handout from the Thai Royal Household Bureau taken and released on May 4, 2019 shows Thailand's King Maha Vajiralongkorn sitting beside Queen Suthida during his coronation in Bangkok AFP/Getty Images Coronation of Thailand King Maha Vajiralongkorn: In pictures In this image made from video, Thailand's King Maha Vajiralongkorn, left, sits on the throne in front of Queen Suthida as he is officially crowned king at the Grand Palace in Bangkok, Thailand AP Coronation of Thailand King Maha Vajiralongkorn: In pictures This screengrab from Thai TV Pool video taken on May 4, 2019 shows Chief Brahmin Phra Ratcha Khru Vamadeb Muni addressing Thailand's King Maha Vajiralongkorn during his coronation in Bangkok AFP/Getty Images Coronation of Thailand King Maha Vajiralongkorn: In pictures Thai royal guards attend the coronation ceremony of Thai King Maha Vajiralongkorn Bodindradebayavarangkun outside the Grand Palace in Bangkok, Thailand EPA Coronation of Thailand King Maha Vajiralongkorn: In pictures Thai people watch the coronation ceremony of Thai King Maha Vajiralongkorn Bodindradebayavarangkun on a large screen outside the Grand Palace in Bangkok, Thailand EPA Coronation of Thailand King Maha Vajiralongkorn: In pictures Volunteers watch the crowning of King Maha Vajiralongkorn during the Royal Coronation on May 4, 2019 in Bangkok, Thailand Getty Images

Yet bizarrely, the commission said on Wednesday that while the second placed party of General Prayuth would receive an extra 18 of the “party list” seats, Pheu Thai would receive none.

Pheu Thai and a coalition of pro-democracy parties calculated, based on preliminary results, they would have around 255 of the 500 seats – giving them a claim to have first go at forming a government.

The way the seats were ultimately allocated meant they had just 245, prompting widespread accusations on social media that the election commission had deliberately interpreted the formula for the party list seats in a way that ensured Pheu Thai fell short of a majority.

Anon Chawalawan, a researcher from the Thai human rights and transparency NGO iLaw, told The Independent the election commission had awarded seats to tiny political parties that won as few as 30,000 votes nationwide, rather than giving them to the major opposition bloc, in a way that appeared contrary to the rules set out for proportional representation in the constitution.

“When the election commission presented the results to the media, they did not say what the procedure was, how these seats were calculated,” Mr Chawalawan said. Even now, six weeks after the votes were cast, “the whole issue remains uncertain”. “This is not what we would call transparent,” he said.

Pheu Thai issued a statement saying the election commission (EC) “deliberately intended to commit wrongdoing and misused its power, violating the constitution and the law. The party will later take legal measures in every aspect against the EC,” it said.

Under Thailand’s system, 250 unelected members of the senate, the upper house of parliament, also get to take part in a vote to select the prime minister. All 250 are selected by the military.

General Prayuth should therefore easily be able to return to office because he only needs to get on board the support of around 60 members of smaller parties to form a coalition surpassing 375 votes in both the lower house and senate.

But he will struggle to pass any meaningful legislation if his opponents control the lower house, and a minority government would not be expected to last long.

Aside from the skewed system in which they were operating, opposition parties have complained of widespread intimidation tactics and irregularities on the day of the vote itself.

The NGO Forces of Renewal for Southeast Asia issued a report which it said documented instances of election fraud crowdsourced from thousands of Thai citizens’ eyewitness accounts and then verified by the organisation’s experts.

The report identified eight different types of voting irregularities, and concluded from its evidence that “beyond any doubt, the long-promised elections were rigged to ensure a victory of the pro-junta party”.

Support free-thinking journalism and attend Independent events

The scale of fraud on election day was “unprecedented” in Thailand, the report’s lead author Dr Pavin Chachavalpongpun told The Independent. Irregularities, he said, “included the state tampering with ballot boxes, using unauthorised vehicles to transport ballots, deliberately destroyed campaigning materials of opposing parties, as well as the obvious tactic of vote-buying”.

A second opposition party also performed strongly in the main vote on 24 March. The newly-formed Future Forward Party appears to have spooked the military leadership by winning an impressive 87 seats based on the preliminary count.

On Wednesday, the election commission reduced its seat total to 80, further hurting the chances of the pro-democratic alliance which it too had joined.

The party’s secretary-general, Piyabutr Saengkanokkul, called the commission’s calculations “absurd”. Meanwhile its leader, Thanathorn Juangroongruangkit, has faced efforts to get him disqualified from politics, with several cases brought by prosecutors still pending.

The election commission has denied being biased towards extending the military regime. It defended the lengthy delay in announcing results, saying it could not declare the party list winners until all complaints of election misconduct had been settled.