BANGKOK: For five years, Thailand's Prayuth Chan-o-cha ruled undisputed as the head of a military government that had grabbed power from a democratically elected government. Now, he looks poised to become a civilian prime minister himself.
It would likely be a tough transition for the imperious former army chief, who can hope to stay on despite Sunday's inconclusive general election, thanks to changes critics say his government made to skew the parliamentary system in favour of the military government.
Prayuth will need patience and compromise to work for the first time with an opposition and coalition allies - these are not qualities associated with a leader who, after a career in the military, appears more comfortable with command and control.
His government will have to develop "some significant savvy at parliamentary wheeling and dealing to ... govern without resorting to threats," said Anthony Nelson, director at the DD-based advisory firm Albright Stonebridge Group.
The election came at a sensitive time - just six weeks before the coronation of King Maha Vajiralongkorn. He assumed the throne after the death of his father, who reigned for 70 years. Any government that emerges will take over after the elaborate May 4-6 coronation.
"Investors will be watching closely the next several months to see if Thailand's political stability holds through the coronation and the formation of the next Cabinet," Nelson said.
Prayuth's pro-army party said the former general's leadership skills will help him adapt to a civilian role.
"He's a highly merciful person. If he is in a civilian government, you will see him turn over a new leaf. You will see good things from him," Anucha Nakasai, a board member of the Palang Pracharat party, told Reuters.
Prayuth's ambition to extend his rule through the ballot box is not assured. The results of Sunday's poll are still unclear and although the Palang Pracharat appears to have won the popular vote, there is a chance that it will fall short of the parliamentary seats required to rule.
If Prayuth does make it, his government may be vulnerable to charges that he did so only because of a constitutional change introduced three years ago by the military government that made it very difficult for its opponents to win an election.
His legitimacy won't be helped by suspicions that the election was manipulated to thwart a party loyal to the military government's populist nemesis, self-exiled former prime minister Thaksin Shinawatra.
Prayuth will also have to make concessions to coalition partners, whose price for support may be powerful cabinet seats.
His biggest challenge, however, might be in parliament.
He can become prime minister thanks to the near-certain backing of the army-appointed members of the 250-seat Senate that would give him the overall majority of 376 parliament seats that is required to form a government.
However, his coalition may not command a majority in the 500-strong lower House of Representatives and could be outnumbered by a "democratic front" of opposition parties, the biggest of which will be a Thaksin-linked party.
That would make the government vulnerable to confidence motions brought by the opposition. It would also be recipe for legislative log jams and political deadlock, and potentially a public backlash that triggers renewed social unrest.
The military coup of 2014 ended a decade of street protests by Thaksin's bitter opponents, the "yellow shirts" of the urban elites and monarchists, and counter-protests by Thaksin's "red shirt" loyalists.
"Policy-making is likely to become more public and contested," said Nattabhorn Juengsanguansit, director at Asia Group Advisors, a government relations advisory.
"Unlike during the past five years (when) the cabinet faced little political opposition to proposals, the increased number of stakeholders empowered by the elections will invigorate a public debate on policy directions and force the Palang Pracharat and its allies to publicly defend policy choices."
She said these factors could delay the passage of a budget and further hold up other projects such as the auction of monopoly concessions for airport duty-free shops and a multi-billion-dollar high-speed rail network.
Prayuth was born in 1954 to a military family in the northeastern province of Nakhon Ratchasima, and his army career was forged during a turbulent period.
He was in pre-cadet school in 1973 when student protests brought down a military regime, ushering in democratic rule. Three years later, he was at the prestigious Chulachomklao Royal Military Academy when right-wing mobs massacred dozens of left-leaning student protesters leading to another military takeover.
In the military, Prayuth was known for decisiveness and devotion to the revered monarchy. He rose in the ranks to become army chief, and in 2014 staged Thailand's 13th successful coup.
His reputation for testiness came almost immediately.
Thais became accustomed to their leader losing his temper in public: he once threatened to throw a podium during a press briefing, and another time mused that he could "probably just execute" a roomful of reporters.
But he did display a softer side heading into the election.
He appeared on state television cooking a chicken curry for villagers and riding a tractor with farmers, and a ballad that he wrote himself played repeatedly on the radio.
However, Joshua Kurlantzick of the US-based Council on Foreign Relations said that Prayuth's track record - repression of opponents, an intolerance of criticism and a failure to understand the role of the media - suggested he would struggle to adapt to "a somewhat democratic setting".
(Writing by John Chalmers and Kay Johnson; Editing by Simon Cameron-Moore)