Voters in Thailand are heading to the polls in the country’s first election since the military ousted an elected government in a 2014 coup.

Prime Minister Prayuth Chan-ocha, the army chief who led the coup, is hoping to extend his hold on power after engineering a new political system that aims to stifle the influence of big political parties not aligned with the military.

About 51 million people are eligible to vote. Leaders of political parties opposed to military rule have urged a high turnout as the only way to derail Mr Prayuth’s plans.

The junta leader was among the first to vote in the Thai capital Bangkok, arriving in a Mercedes, after polling booths opened at 8am local time.

Speaking to reporters after casting his ballot, Mr Prayuth said, “I hope everyone helps each other by going to vote today as it’s everyone’s right.”

Thailand Election
Thailand’s Prime Minister Prayuth Chan-ocha casts his vote (Gemunu Amarasinghe/AP)

The election is the latest chapter in a nearly two-decade struggle between conservative forces including the military and the political machine of Thaksin Shinawatra, a tycoon who upended tradition-bound Thailand’s politics with a populist political revolution.

Mr Thaksin was ousted in a 2006 military coup and now lives in exile abroad to avoid a prison term, but parties allied with him have won every election since 2001.

His sister, Yingluck Shinawatra, who led the government that was ousted in 2014, also fled the country after what supporters said was a politically motivated corruption prosecution.

Thailand’s powerful King Maha Vajiralongkorn issued a statement on the eve of the election that said the role of leaders is to stop “bad people” from gaining power and causing chaos.

Invoking a speech by his father, the previous Thai king who died in 2016 after reigning for seven decades, King Vajiralongkorn said not all citizens can be transformed into good people so leaders must be given support in ruling to create a peaceful nation.

He urged government officials, soldiers and civil servants to look after national security.

Thailand Election
A woman votes her ballot in the general election at a polling station in Bangkok (Sakchai Lalit/AP)

It was the monarch’s second notable intervention in politics recently. Last month, he demanded his sister Princess Ubolratana Mahidol withdraw as a prime ministerial candidate for a small Thaksin-allied party within 24 hours of her announcement.

One of the first people to vote, 92-year-old Prabha Svarachorn, echoed the royal statement.

“I come to vote whenever there is an election,” she said. “I think it’s our duty to vote for good people. I would like people to come to vote.”

Political parties and their main leaders held their final major rallies on Friday evening in Bangkok.

Thailand Election
Thanathorn Juangroongruangkit, leader of Future Forward Party, casts his vote(Julladit Onlamoon/AP)

Sudarat Keyuraphan, leader of the main pro-Thaksin party, Pheu Thai, said it would fight to overcome constitutional hurdles erected against it by Prayuth’s regime.

“In 2014, they took power with the barrel of a gun, by a coup,” she said. “In 2019, they are trying to take away the people’s power again through crooked regulations under the constitution.”

Concerns about a slowing economy under Mr Prayuth’s rule have been an issue in the campaign.

Mr Sudarat told the crowd, “Every time we come back, the economy improves, right?”

When it seized power in 2014, the military said it was to end political unrest that had periodically turned violent and disrupted daily life and the economy. The claim has been a major selling point for Mr Prayuth.