Surachart Thienthong of the Pheu Thai Party won a by-election in Bangkok's Constituency 9 by a landslide on Sunday.
An unofficial result from the poll on Sunday night showed the opposition party candidate received 29,416 votes, while Saralrasmi Jenjaka of the Palang Pracharath Party (PPRP) garnered only 7,906 votes.
Krunphol Tiansuwan of the Move Forward Party earned 20,361 votes, while Atavit Suwannapakdee of the Kla Party received 20,047 votes.
The PPRP lost two by-elections in Chumphon and Songkhla provinces last month to the Democrat Party.
Sunday's by-election in Bangkok was called after Sira, the husband of Ms Saralrasmi, was disqualified by the Constitutional Court in December. It ruled he was ineligible to contest the 2019 election due to a fraud conviction handed down by the Pathumwan District Court in 1995 that resulted in an eight-month jail term.
Political pundits have seen the by-election as a popularity test of the government in Bangkok. The capital will hold an election for governor expected mid-2022.
Constituency 9 covers Lak Si district and part of Chatuchak district.
The Election Commission said 167,649 people were eligible to vote in the constituency, which has 280 polling units.
The Ec said 52% of voters cast their votes on Sunday.
Commenting on the unofficial result, Somchai Srisutthiyakorn, a former election commissioner and director of Rangsit University's centre for political research and development, said if the PPRP loses the by-election, it may have to reconsider whether to rely on the reputation of Prime Minister Prayut Chan-o-cha to woo voter support in the next general election.
"The PPRP's defeat is the result of its internal conflict and the image of Sira [Jenjaka]. The party must improve things to win back public recognition," Mr Somchai said.
Chaiyan Chaiyaporn, a lecturer at Chulalongkorn University's political science faculty, said the PPRP's defeat reflects a decline in Gen Prayut's popularity.
Lately, the prime minister appeared to have lacked decisiveness in tackling problems, Mr Chaiyan said, adding the PPRP's popularity will suffer if it still nominates Gen Prayut as a candidate for the same role at the next election.
Mr Chaiyan said the PPRP made a wrong decision in fielding Mr Sira's wife in the by-election."This was a slight to Bangkok residents."
The by-election for Constituency 9, which covers Laksi district and parts of neighbouring Chatuchak district, was the first by-election in Bangkok, and the ninth during the tenure of the present government.
Of the total nine by-elections so far, candidates from government parties won seven, the now-dissolved opposition Future Forward Party secured one victory and the opposition Pheu Thai one victory (Sunday's result).
However, the Jan 16 by-elections in Songkhla and Chumphon saw candidates from the Democrat Party, part of the coalition government, beat candidates from the PPRP.
Analysts said that Sunday's election had little bearing on the government's stability, though the poll took place against a backdrop of the government struggling with an array of problems including the Covid-19 pandemic, the rising cost of living and internal rifts within the ruling party.
Other events in the political calendar, particularly the Bangkok governor election expected this year, will also serve to gauge the popularity of the government which completes its four-year term in March next year, analysts said. The Office of the Election Commission said 167,649 people were eligible to vote in the constituency, which has 280 polling units.