BANGKOK, May 14 (AFP) - Vote counting got under way in Thailand's general election Sunday with pro-democracy opposition parties tipped to defeat the conservative military-backed government of Prime Minister Prayut Chan-O-Cha after almost a decade in power.

Opinion surveys pointed to a resounding defeat for ex-army chief and coup leader Prayut after a campaign that played out as a clash between a young generation yearning for change and the traditionalist, royalist establishment.

The main opposition Pheu Thai party, fronted by the daughter of billionaire former premier Thaksin Shinawatra, was ahead in final opinion polls.

But in a kingdom where victory at the ballot box has often been trumped by coups and court orders, there are fears the military could seek to cling on, raising the prospect of fresh instability.

Polling stations closed at 5:00 pm (1000 GMT) after a smooth day of voting, with no major problems reported by Thai media.

Preliminary results are expected later in the evening, though the final number of seats won by each party will not be officially confirmed for several weeks.

After casting her ballot in Bangkok, Pheu Thai's main candidate Paetongtarn Shinawatra showed no signs of nerves.

"Today is going to be a good day. I have very positive energy about it," the 36-year-old told reporters, smiling broadly.

Millions of Thais cast ballots at 95,000 polling stations scattered from the lush-forested mountains of the north to the idyllic sands of the southern beaches.

A turnout of 90 percent in last Sunday's early round of voting pointed to an electorate looking for change, but the opposition faces an uphill battle to secure power, thanks to the junta-scripted 2017 constitution.

The new premier will be chosen jointly by the 500 elected MPs and 250 senate members appointed by Prayut's junta -- stacking the deck in the army's favour.

In the controversial last election in 2019, Prayut rode senate support to become prime minister at the head of a complex multi-party coalition.