Official results for Thailand's first election since a 2014 putsch put a pro-military party within striking distance of forming the next government and returning coup leader Prayuth Chan-ocha as prime minister.
A "democracy front" of seven allied parties hoping to block Prayuth's return fell just short of a majority of the 500 seats in the popularly elected House of Representatives and has already vowed to challenge the count in court.
The results of the March 24 poll, released over a two-day period this week, give the pro-military Palang Pracharath party 115 seats in the lower house. Along with the 250 seats in the junta-appointed Senate likely to vote its way, the party now has nearly half the combined seats in the upper and lower houses it needs to make Prayuth, its candidate, prime minister.
The results give the democracy front a combined 245 seats in the lower house, not enough to frustrate any government the pro-military parties might form, and far from the 376 needed to elect the prime minister.
With no clear winner yet to emerge, both camps are scrambling to pull in more seats from smaller parties.
But pundits expect Palang Pracharath to have an easier time wooing the smaller of the 26 parties elected to the lower house — a record high for Thailand.
While 350 constituency seats went to candidates who won the most votes in their districts, the other 150 were doled out to parties based on their candidates' combined national share of the vote.
But the commission's formula for handing out those party seats has faced heavy rebuke.
Ahead of the poll, the commission touted a formula that would have kept many of the smaller parties out of parliament. After a strong showing by the democracy front parties on election day, the commission drew up a new formula that brought in the smaller parties.
Fourteen parties now have a one party-list seat each. The most prominent party in the democracy front, Pheu Thai, which ran a close second to Palang Pracharath in the popular vote, won no party seats at all because its share of constituency seats exceeded its take of the national vote.
Thepparith Senamngern, deputy spokesman for Pheu Thai, said his party was likely to file a complaint over the election commission's formula with the Constitutional Court in a matter of days.
On Wednesday, the court ruled that a provision in a law on electing legislators complied with the constitution. The court, however, did not rule on the formula itself, which Pheu Thai claims breached the charter and robbed the democracy front of about 10 seats, enough for a majority in the lower house.
"Right now Pheu Thai has, with the legal team, been discussing a lot to actually go to the court to actually say that the calculation that the election commission wished to use is not legitimate, and we're now going to pursue that pathway," Thepparith said. "So I think within a few days we should be able to see our team go to the court."
In the meantime, he said the democracy front was in talks with other parties to try to land the six additional seats it needs for a lower house majority, but declined to name them.
"The party seniors have been talking to a lot of senior members of other parties, even after [the] elections. Some have been more positive, some have been more neutral, a lot of them have been saying let's wait until the actual number comes out," he said. "I don't think it's the end game yet."
Yutthaporn Issarachai, a political scientist at Sukhothai Thammathirat Open University, said the front was unlikely to pick up any more seats.
He said about 15 parties have declared for Palang Pracharath already and that stragglers were likely to ally with the pro-military party as well, given how close it was to holding enough seats to pick the next prime minister.
"I think senators will vote with the Palang Pracharath, so small parties can see this," he said.
The democracy front also risks losing some of its current seats.
Leaders of the Future Forward Party, a key front member, are facing lawsuits on charges that they deny. If convicted, the party will be stripped of both constituency seats and votes won.
Whichever camp prevails, Yutthaporn said the next government will be fragile, based on a coalition of many parties with a slim majority in the lower house, ever vulnerable to defections.
"In the future, we [will] have a stability problem with the government and with the parliament," he said. "The next government cannot [be] stable."
Calls to a spokesman for Palang Pracharath went unanswered.
The election commission did not respond to a request for comment on Thursday. The commission has previously denied any bias.