Thailand’s junta looks likely to hang on to power after official results from the general election were finally announced following a 45-day delay that raised serious questions about the complex formula used to calculate the vote.

Thailand has been in political limbo for six weeks while the election commission refused to release the official results of the 24 March poll. It was the first in eight years and was supposed to mark the country’s return to democracy after five years of rule by a military junta.

The official results, released late on Wednesday evening, confirmed what the preliminary results had shown: that Pheu Thai, the pro-democracy party aligned with the exiled former prime minister Thaksin Shinawatra, won the most seats, with 136.

However, Pheu Thai cannot form a government because it fell well short of the 250 seats needed for a majority in the lower house.

Pheu Thai supporters at the party’s Bangkok HQ cheer the unofficial results after the polls closed on 24 March. Photograph: Rungroj Yongrit/EPA

In the week after the election, Pheu Thai and six other parties claimed they had formed a coalition which had 255 seats and was ready to govern, but the results released on Wednesday showed that this “democratic front” only had 245 seats.

Pheu Thai pledged to “pursue every legal means” to challenge the results, describing the complicated formula used to partly calculate the seats as an “an intentional abuse of the law and against the constitution”.

The junta’s proxy political party, Phalang Pracharat, which ran in the election as a way for the military to hold on to power through the ballot box, came second with 115 seats.

However, thanks to a new constitution drawn up by the military in 2016, it has the power to appoint all 250 seats of the senate, the parliamentary upper house. The senate votes with the lower house on who becomes prime minister, meaning that the military needs only 126 seats in the lower house to bring back the junta leader, Prayut Chan-ocha, as prime minister. Whoever is prime minister has the power to assemble a cabinet and is the leader of the government.

There are several small parties known to have military sympathies, which could provide enough votes to secure Prayut as prime minister. The junta will also be looking to these parties to help form a pro-military coalition that can hold a 250-seat majority in the lower house, so that Prayut will not have to preside over an unstable minority government which would be unable to pass any legislation and would probably fall apart in weeks or months.

“We will coordinate with other parties who share our ideology and are interested in forming a government together,” said the Phalang Pracharat leader, Uttama Savanayana, on Wednesday.

There are multiple factors which have cast a shadow over the legitimacy of the election and the results. The unexplained delaying tactics by the election commission – which was appointed by the junta – in announcing the result have raised suspicions that it was buying time to find ways to skew the vote against the pro-democracy opposition, who had won the most seats, and advantage the military.

There were questions in particular over the allocation of “party list” MPs. Under Thailand’s new constitution, MPs are appointed both through constituency votes and through a complex formula of proportional representation.

However, it became clear after the March election that the electoral commission did not understand, or had not clearly established, the party list formula, causing confusion and allegations it was rigging the calculations to favour a pro-military coalition.

This appeared to be the case. The formula used gave seats to 27 parties overall, a record in Thai politics, and dropped the threshold from one seat per 71,000 votes to one seat per 30,000 votes. Giving party list seats to smaller parties, and taking them away from big parties such as Pheu Thai, benefits the pro-military coalition, which is more likely to get these small parties on its side.

The election commission chief, Somchai Sawaengkan, denied that the calculations had been manipulated. “We have done everything in accordance with the law,” he said.

There have also been reports that the process of the election was tainted by irregularities and fraud. A report by the NGO Forces of Renewal for Southeast Asia used crowdsourced and then verified information from Thai voters to document alleged “systemic fraud” including hundreds, sometimes thousand, of instances of electoral commission malfunctions, miscounted ballots, military pressure on voters to vote for junta parties, vote buying and ballot box irregularities allowing for vote stuffing on election day.

Thanathorn Juangroongruangkit, the leader of the pro-democracy Future Forward party, greets supporters as he arrives at a police station to hear a sedition complaint filed by the army last month. Photograph: Athit Perawongmetha/Reuters

The report said the evidence “exposes the systemic fraud and other irregularities during the 2019 election, pointing to a coordinated and methodical effort to facilitate the victory of pro-junta political forces”.

Wednesday’s official election results also confirmed that Future Forward, a new pro-democracy party that has a progressive agenda including reform of the military and the constitution and that has shaken up the political landscape, came third in the election with 80 seats.

Its success appears to have rattled the military, which since 24 March has made repeated efforts to persecute the Future Forward leader, Thanathorn Juangroongruangkit, and get him disqualified from politics. There are several cases still pending against him.

Speaking on Wednesday, Thanathorn told a press conference that Future Forward would throw its weight behind any party “that does not support Prayut as a prime minister in order for our democracy to move forward”.