This was not the script that Thailand's generals had in mind when they agreed to hold elections just 15 months after staging a coup. Little did they imagine that Thaksin Shinawatra, the man they deposed as prime minister, a man still facing a raft of corruption charges, would pull off a stunning comeback. But that is exactly what he managed yesterday – by proxy at least.
Preliminary results of the parliamentary poll suggested that the People Power Party (PPP), which backs Mr Thaksin and his populist policies, was on course to win the largest share of seats.
Even though it appeared an absolute majority had eluded the PPP, the generals who ousted Mr Thaksin last year – and the middle classes who had demanded his resignation at a series of street demonstrations – must today be gnashing their teeth.
The billionaire former tele-communications magnate and owner of Manchester City Football Club, who went into exile after the bloodless coup in September last year, was said to be watching the election closely from Hong Kong. And if one of his allies is to be believed, he will be planning a triumphant return home, possibly on Valentine's Day.
Thailand's generals had hoped their attempts to sideline Mr Thaksin and his supporters had been successful. They claimed their aim was to restore democracy and heal the deep political divisions of the past two years, but the result shows how badly they misjudged the electorate.
Now the vote looks likely to spark more instability, and possibly another coup. Both pro and anti-Thaksin camps have threatened to take to the streets if they suspect the other side of winning the election unfairly. If that happens, the army could step in again – for the 19th time in 75 years of on-off democracy in Thailand – claiming to be acting in the interests of "national unity".
And as to what will happen if and when theMr Thaksin, 58, returns home, that remains shrouded in uncertainty. In theory, he could be arrested as soon as he sets foot on Thai soil. A judge issued warrants for him and his wife, Pojarmarn, in August, declaring that their failure to attend a court hearing on the corruption charges suggested they were, "evading prosecution". If found guilty of offences relating to a land deal in 2003, they could be jailed for up to three years.
Even if he escapes the wrath of the courts, Mr Thaksin's political future is uncertain. His Thai Rak Thai (Thais Love Thais) party was outlawed after the military takeover, and he and other senior party members were barred from holding office for five years. But he remains hugely popular with the rural poor, who make up the majority of the electorate, thanks to policies that included cheap loans, virtually free medical care and village-based development schemes.
The PPP – widely regarded as a reincarnation of Thai Rak Thai – openly campaigned on a platform of bringing Mr Thaksin back from exile and continuing his populist policies. And it did not disguise close links with the former PM. In fact, Samak Sundaravej, the party's leader, cheerfully admitted he was a figurehead for Mr Thaksin.
Unofficial early results from the Thailand's Election Commission suggested that, with 93 per cent of the vote counted, the PPP had won 228 seats in the lower house. That would leave the party just short of the 241 seats required for an absolute majority, and needing to forge an alliance with at least one minor party. The rival Democrat Party won 161 seats, according to the early results. Mr Samak told a press conference that the former PM had telephoned him from Hong Kong. "Thaksin said congratulations," announced the PPP leader.
Mr Samak, also called on "any political parties" to join the PPP in a coalition. He said the 45 million voters in the predominantly Buddhist south-east Asian country had followed their emotions. "What Thaksin did for them five years ago is still in their hearts," he said. "They are thinking of him."
Forty parties contested the seats, but the real contest was between the PPP and the Democrat Party – Thailand's liberal and oldest party that provided the main opposition during Mr Thaksin's five years in power.
Political convention has always dictated that the party with the most seats gets the first opportunity to try to form a government. The PPP said it would try to control at least 300 seats by striking deals. But analysts said that the military would still be hoping that the Democrats could put together a coalition.
The generals and the royalist establishment, which Mr Thak-sin's supporters blame for the coup, are expected to do everything they can to prevent the PPP from taking power, including tabling allegations of electoral fraud against candidates and potential partners.
Although support for the Democrat Party could also come from foreign investors, who are reassured by its Eton and Oxford-educated leader, Abhisit Vejjajiva, there was just one person dominating the election story yesterday – Mr Thaksin.
A former lieutenant-colonel in the Royal Thai Police, he entered politics in 1994 and won a landslide election in 2001. He gained instant popularity with the rural masses, thanks to policies that included a debt moratorium for farmers. His economic programme was known as "Thaksinomics".
Showing a ruthless streak in cracking down on illegal drugs and a Muslim insurgency in the south of the country, Mr Thaksin was re-elected in January 2006 with the biggest parliamentary majority in Thai history.
But the prime minister, whose family had amassed enormous wealth through their ownership of the country's biggest mobile phone operator, the Shin Corporation, never endeared himself to the middle classes.
In January 2006 the family sold their stake in the company to Singaporeans, reaping a profit of nearly $1.9bn and paying no tax. Mr Thaksin was cleared of breaking the law, but it was the last straw for the urban intelligentsia, who staged months of demonstrations, calling on him to resign. The prime minister resisted the pressure, but while he was in New York in September, preparing to address the General Assembly of the United Nations, he was overthrown.
Perhaps wisely, he remained overseas, spending a large chunk of time in London, where he whiles away his time shopping for handbags for his wife and daughters and singing karaoke with a Thai pop star named Lydia.
The English capital cannot cater to his every whim. He has admitted that finding a decent barber was a challenge. "The hairdressers in London cut it either too short or too funky," Mr Thaksin confided. "Sometimes he made me look like a teenager."
For "real wine and homemade food" France was the hop of choice, while Miami provided the allure of top golf clubs where he could finesse his swing.
These details – revealed in a book called Thaksin, Where Are You, written by a lieutenant in the Thai armed forces Sunisa Lertpakawat – got Thailand chattering but in exile, Mr Thaksin claimed to have retired from public life. He told Time magazine: "After being ousted, I had a very good excuse to quit politics."
Recent actions speak otherwise. After buying Manchester City FC for nearly £82m, he signed three Thai players of dubious proficiency, which some saw as a blatant attempt to win votes in football-mad Thailand.
In a videotaped message played at the signing ceremony in Bangkok, Mr Thaksin declared: "When I was your prime minister, I ran a government that promoted and defended free and fair elections. As the December elections approach, I hope the military junta and the next government will do the same."
Last month, Mr Thaksin thrilled football fans further, saying he planned to bring the entire Thai national squad to England to train with City. The Democrats responded by announcing a tie-up with Everton for a series of football clinics.
The election result heralds more turbulence for Thailand, with legal challenges expected over the validity of some PPP candidates and the arguments likely to drag on for months. If the PPP or Democrat Party manages to form a coalition, it would probably be weak and not last more than a year or two. In the event of a stalemate, the courts could nullify the poll.
Another possibility is a government of national unity, composed of politicians from the major parties, which would reflect recent calls for reconciliation by Thailand's revered King Bhumibol Adulyadej.
If the PPP forms a government with partners, Mr Samak – a 72-year-old ultra-rightist with an acid tongue and an earthy style – will be prime minister. Mr Samak, who is disliked by the middle classes and the English-language press, allegedly stirred up right-wing mobs which killed leftist student activists in 1976.
The Democrats leader could not be more different. Mr Abhisit is a handsome 43-year-old with an impressive CV; however, analysts say he has an inability to connect with grassroots voters and win broad support.
Whichever – if either – of the two men becomes prime minister, it is Mr Thaksin who will be the real focus of interest. Will he come home to face the courts, as he promised to do after the election? If he does return to Thailand, what political role will he play? And how much influence will the generals allow him to wield? It seems that Thailand's political crisis is far from over.