ARTICLE AD BOX
By Jonathan Head
BBC News, Bangkok
Former prime minister Thaksin Shinawatra has returned to Thailand after 15 years in exile, hours ahead of a vote that determines who will be the country's next leader.
Thailand's most successful elected leader has long been feared by conservative royalists, who have backed military coups and contentious court cases to weaken him.
But now the brash, politically-ambitious telecoms tycoon is back, presumably after striking a quiet deal with the same men who unseated his party in a 2014 coup to keep him out of prison. He has sentences of up to 10 years outstanding from criminal cases he says were politically motivated.
He landed in the capital Bangkok at 09:00 local time on a private jet from Dubai via Singapore. There were cheers, speeches and songs from hundreds of his ecstatic supporters as Mr Thaksin finally made good on the many promises he has made to return. Many had travelled overnight from his party's stronghold in north-eastern Thailand to witness this moment.
But Mr Thaksin was unable to greet them. Flanked by his two daughters and son, he emerged briefly from the airport terminal and paid his respects to a portrait of the king and queen.
He has now been taken to the Supreme Court, which will decide what to do about the prison sentences imposed on him in his absence. No-one expects him to stay in custody long.
Outside the Don Mueang Airport, 63-year-old Samniang Kongpolparn had been waiting since Monday evening to see Mr Thaksin. She, like many of the other supporters who had gathered there, had travelled from Surin province in the northeast, the stronghold of Mr Thaksin's party in past decades.
"He's the best prime minister we've ever had. Even though I won't get to see him today, I still wanted to come to show him support," she said. "I'm ok with them reconciling with the pro-military government, or else we're stuck with the senators. We don't want that."
Mr Thaksin's Pheu Thai party is expected later today to join a coalition government - a byzantine process which in three months has taken Thailand full circle.
It began with the heady hopes of a new dawn led by the radical young Move Forward party, which won the most seats in the May election.
Move Forward initially formed a partnership with Pheu Thai but it's now certain that the coalition will include almost everyone but the reformers, including two parties led by former coup-makers - a deal with its sworn enemies that Pheu Thai vowed it would not do.
Pheu Thai insists the two developments are unconnected. Few people believe that.
It is true that Pheu Thai's hands have been tied by the unelected senate, a 250-seat constitutional landmine planted in Thailand's political landscape by the military junta which ruled for five years after a 2014 coup.
And Pheu Thai's bargaining position was weakened by its poorer-then-expected performance in the election, when it lost a lot of support to Move Forward and for the first time was relegated to second place.
The senators, all appointed under the junta, are allowed to join the 500 elected MPs in voting for the new prime minister. Their thinly-disguised remit is to block any party which might threaten the status quo - the nexus of monarchy, military and big business which has dominated decision-making in Thailand for decades.
Unsurprisingly they refused to back the Move Forward-led coalition with Pheu Thai, despite its commanding majority in the lower house. When it was Pheu Thai's turn to negotiate a new coalition, its need for senate support meant it had to take in some of its former opponents.
However some Pheu Thai politicians argue that the party should have held out for a better deal, by refusing to be in a government with the most hard-line conservative groups. Any minority administration formed without Pheu Thai and Move Forward would quickly collapse, because the senators cannot join normal parliamentary votes on issues like the budget.
But the Pheu Thai leadership was not willing to wait; it even invited the ultra-royalist party United Thai Nation to join the coalition, whose leaders have in the past been virulently critical of the Shinawatra family and their supporters, and were instrumental in ousting the last Pheu Thai government led by Thaksin's sister Yingluck. That these two factions will now sit together in the same government is a mark of how far Thai politics has shifted.
In the end for the ultra-royalists the perceived threat posed by Move Forward, and by a younger generation of Thais demanding a conversation about the power and wealth of the monarchy, eclipsed their long feud with the Shinawatra family.
For the Shinawatras, and Pheu Thai's more conservative, business-minded elements, getting into government again and guaranteeing the deal to bring Thaksin back, have been bigger priorities than worrying about the party's reputation.
But there are those, even within Pheu Thai, who are horrified by the cynical pragmatism of this deal. They are warning that the party will lose even more of its once-passionate grass-roots supporters, and lose, perhaps forever, the dominance it held over electoral politics in Thailand for two decades.