The opposition Pheu Thai Party has won the most seats in Thailand’s first election since a military coup in 2014, the country’s Election Commission says.
Backed by ousted former PM Thaksin Shinawatra, the party took 136 seats, while the ruling pro-military Palang Pracha Rath Party (PPRP) took 115.
However the 250-seat Senate is expected to back PPRP, giving them an advantage in their bid to stay in power.
The vote count was marred by delays and complaints of irregularities.
Results were released more than six weeks after voting, and come days after a three-day coronation that saw the country’s King Maha Vajiralongkorn crowned in a series of elaborate ceremonial rites.
Thailand has been buffeted by political instability for years, largely a battle between supporters of the military and former Prime Minister Thaksin.
The country has long been politically split between populist politicians who appeal to rural and poorer voters, and their opponents – who tend to support the military and draw votes from the urban middle class and elites.
The 2014 coup was the 12th time the military has toppled the government since absolute monarchy ended in the 1930s.
What does the result mean?
A vote for the next prime minister is expected to happen within a few weeks.
The result means that the military government will remain in charge, and its current military leader Prime Minister Prayuth Chan-ocha of the PPRP is likely to keep his job.
Under the election rules, the Senate votes together with the house to pick the next prime minister – and the military picks all 250 seats in the upper house.
This means the PPRP needs fewer small parties to support it in order to gain enough votes in the house and Senate combined to choose the next leader.
The military has been criticised for taking steps to ensure it would remain influential in politics, including changing the constitution in 2017.
Results finally released
By Jonathan Head, BBC Southeast Asia correspondent
It has been more than six weeks since Thais voted in an election which was supposed to return the country to civilian rule.
Early results showed a clear divide between those backing continued rule by the coup-makers and their supporters, and those demanding an end to military involvement in politics.
But it has taken the much-criticised Election Commission (EC) this long to finalise the results, in particular 150 seats allocated proportionally.
The method it used is controversial; it has given seats to some very small parties, one with fewer than 34,000 votes nationwide, thus denying earlier opposition hopes that their alliance would hold a majority.
A series of dubious lawsuits have also been filed against Future Forward, a new opposition party that performed unexpectedly well.
Everyone now expects coup-leader General Prayuth Chan-ocha to try to form a government in a coalition of 20 parties.
But he may be strongly opposed by those who believe the entire election system unfairly favoured him, and such an unwieldy coalition may not last long.
Why did it take so long to get results?
The EC has been accused of releasing delayed and inconsistent results.
It abruptly stopped publishing numbers after the vote took place, blamed the media when its own data was suspect and then said its servers had suffered from unspecified hacking attacks.
The election has also been referred to as riddled with “irregularities”, according to former leader Mr Thaksin. He said it made the country “lose its credibility”.
He was removed by a coup in 2006 and lives in self-imposed exile to avoid a conviction in Thailand for abuse of power. However, he remains hugely influential in Thai politics.
How are Thailand’s leaders chosen?
There are 750 seats in parliament but Thailand’s electorate only votes for the 500 lower house seats as the members of the 250 upper house seats are appointed by the military.
Of the 500 seats, 350 are elected using a first-past-the-post system, and the remaining 150 MPs are allocated according to a proportional formula.
There has been a lot of confusion over the formula, with critics saying it is designed to hurt bigger parties and help smaller parties.