(Bloomberg) -- About 51 million people are heading to the polls in Thailand’s general election on Sunday after nearly five years under a military government that’s trying to keep its leader as prime minister.

The junta chief, Prayuth Chan-Ocha, is backed by the royalist and military elite who have long dueled for power with exiled former leader Thaksin Shinawatra. Thaksin or his allies, who draw support from the rural poor, have won every election since 2001, only to be unseated by coups or the courts.

The contest between these dominant forces is expected to play out again. Late Saturday, Thailand’s King Maha Vajiralongkorn released a rare statement that in effect asked citizens to back "good people" for government in the interests of national stability.

Polls opened at 8 a.m. and will close nine hours later, when counting begins. Provisional results on vote share and constituency seats won by each party are expected on Sunday night. But it may take weeks to certify the tally, form the expected coalition government and pick a premier.

The vote is taking place under a military-backed constitution, Thailand’s 20th. Critics say the charter gives appointed soldiers and bureaucrats in a planned 250-strong Senate the power to stifle elected politicians in the 500-seat lower house.

The establishment is trying to extend and "legitimize its power" through the election and the constitution, said Punchada Sirivunnabood, an associate professor at Mahidol University’s Faculty of Social Sciences and Humanities near Bangkok.

A big turnout is expected in Southeast Asia’s second-largest economy, after Thais thronged ballot boxes in advanced voting last weekend.

Once the vote is certified, parliament must convene to elect a premier. A candidate needs a majority in a joint vote of both chambers to become prime minister. That potentially gives ex-army chief Prayuth a major advantage if the junta-appointed Senate backs him en bloc.

At the same time, the deep divisions in Thai politics could also bring gridlock to the legislature. The splits -- which triggered bloody street clashes before the coup -- flared anew in a dramatic run-up to the vote.

A Thaksin-linked party, Thai Raksa Chart, was disbanded earlier in March for hostility toward the constitutional monarchy, after Vajiralongkorn rejected the party’s nomination of his sister Princess Ubolratana Rajakanya as its prime ministerial candidate.

The dissolution by the Constitutional Court was seen as hampering Thaksin’s allies while bolstering Prayuth, who seized power in 2014.

The uncertainty around the election could weigh on the export and tourism-reliant economy, whose growth lags behind peers in the region.

Thailand is already grappling with risks from a surge in the baht amid slowing global trade. Unsettled foreign investors have pulled out in excess of a net $700 million from Thai stock and bond markets this year.

(Updates with king’s statement in third paragraph.)

To contact the reporter on this story: Siraphob Thanthong-Knight in Bangkok at rthanthongkn@bloomberg.net

To contact the editors responsible for this story: Sunil Jagtiani at sjagtiani@bloomberg.net, Ruth Pollard

©2019 Bloomberg L.P.