BANGKOK (AFP) - Thailand's 2014 coup leader and junta chief Prayut Chan-o-cha is one step closer to power after a shock election on Sunday (March 24) that lifted his party ahead in the popular vote.
Army-aligned Palang Pracharath won more than 7.6 million votes, about 400,000 votes ahead of Pheu Thai, the party linked to exiled former premier Thaksin Shinawatra.
But preliminary figures show Pheu Thai won in 137 constituency seats nationwide, compared to Palang Pracharath's 97.
So who is actually leading, and what happens next?
WHO WON THE ELECTION?
Both parties have claimed the right to lead Thailand's next government, leaving voters confused.
Palang Pracharath believes winning the popular vote gives them the mandate.
But Pheu Thai disputes this, saying they now hold more of the 250 available constituency seats in the 500-seat Lower House.
This is where it gets tricky.
Both are now in negotiations with other smaller parties to cobble together a majority in the Lower House.
But results for an additional 150 "party list" seats, which will take more of the popular vote into account, have yet to be released.
Loyalties up for grabs include Bhumjaithai, which won 39 constituency seats, and political newcomer Future Forward, led by telegenic frontman and fierce junta critic Thanathorn Juangroongruangkit.
All told, the victorious party needs 376 seats of the 750-member combined Upper and Lower Houses to pick a prime minister.
But the Upper House or Senate is a 250-member body appointed by the junta, virtually guaranteeing Palang Pracharath success.
WAS IT 'FREE AND FAIR'?
Billionaire Thaksin, who has been in self-exile since 2008, told AFP in an interview that the election was "definitely" rigged.
Pressure is mounting on the Election Commission to explain several allegations of irregularities, and the hashtag #RiggedElection has trended on Thai Twitter.
Poll monitor ANFREL says there were 2.8 million invalidated ballots, or around 6 per cent of the total, and the tabulation of votes was "deeply flawed".
But it also said that shortcomings may not have significantly impacted the result.
"I have brought up many, many aspects of this election and repeatedly said it did not meet with certain standards," said ANFREL secretary-general Rohana Hettiarachchie, who pointed to the legal framework underpinning the poll such as the appointed senate.
But, he added, "I think it is unfair if we conclude whether it is free and fair or not".
A candidate from the Democrat Party - which dropped to fifth in the popular vote - filed a complaint on Monday about vote-buying in a southern province the night before the poll.
According to the commission's own figures, the number of ballots cast in some provinces far exceeded the voter turnout - but was dismissed as "human error" when questioned by reporters.
By Tuesday, more than 700,000 people had signed a petition to dissolve the Election Commission.
Pheu Thai's prime ministerial candidate Sudarat Keyuraphan said her party was probing several irregularities in the polls.
HOW DID PRAYUT'S PARTY PERFORM SO WELL?
Pheu Thai and other pro-democracy parties hoped to leverage discontent with a junta that has ruled Thailand for nearly five years after ousting the administration of Thaksin's sister Yingluck in 2014.
But before the elections, junta-aligned Palang Pracharath poached more than 40 MPs from the Pheu Thai party, many of them stalwarts in their constituencies.
These politicians are often seen as the solvers of local problems, and Thai voters - especially in more rural areas - are likely to remain loyal to their patron instead of any party ideology.
Under the wing of most politicians are also people known as "canvassers" working to persuade locals - either in cash or in kind.
Analysts say the impact canvassers have in elections is pivotal.
Palang Pracharath may have also benefited from an election eve message from Thailand's king, who urged voters to support "good people" and not those who create "chaos".
The junta has portrayed itself as the defender of the monarchy.