Thailand’s destructive political crisis is on the brink of its most dangerous phase yet as the prime minister’s opponents press for a “judicial coup” that critics claim risks tipping the country into dictatorship or even civil war.

Supporters of Yingluck Shinawatra’s administration have vowed to rise to defend her if the country’s legal institutions eject her from office via two cases due to conclude in the next few weeks.

The deadly conflict crippling southeast Asia’s second-largest economy has become an increasingly naked struggle between a cronyist but electorally dominant movement centred on Ms Yingluck’s family and an establishment elite-driven opposition determined to oust it.

Jatuporn Prompan, new leader of the pro-government “red shirt” movement, warned this month of civil war if democracy was “stolen” via a “coup” by judicial institutions.

“If the court verdict comes out against the prime minister, we can expect some turbulence,” said Panitan Wattanayagorn, an academic and ex-spokesman for the previous opposition Democrat-led government. “The military and the police must be able to stabilise the situation.”

Thailand’s constitutional court is expected soon to rule on whether Ms Yingluck should be forced to step down over her replacement in 2011 of Thawil Pliensri as national security chief, allegedly to allow her to promote a relation by marriage to the post of police chief.

The court – which has fast-tracked a petition on the case submitted last month by opposition senators – is due to rule on Wednesday on whether to allow the prime minister more time to mount a defence, or whether to move straight to a verdict.

Ms Yingluck could also be ejected by a separate case at the National Anti-Corruption Commission, which is due soon to recommend whether she should be impeached for alleged dereliction of duty over her handling of a financially disastrous government rice subsidy scheme. The premier, who has faced months of street protests, denies all the allegations against her.

The institutions and their defenders say they are acting according to the law, adding that the wide powers they enjoy – including a role in appointing half of the Senate – are justified because of the need to secure Thailand’s fragile democracy.

Critics however say there is a risk the legal cases simply provide more evidence of the pro-establishment bias of the country’s institutions, after a blizzard of rulings that have paid little heed to popular electoral mandates, parliamentary sovereignty or fair judicial process.

The courts have made a series of sweeping judgments dismissing elected officials and dissolving political parties, including sacking two prime ministers in 2008 – one because he received payments for a television cooking show he had presented before taking office.

Kaewmala, a popular pseudonymous social media commentator, said the country’s legal and regulatory institutions were proving anything but “guardians of democracy”.

“In fact they are doing exactly what they were designed to do,” she said. “It has little to do with democracy, but [is] a preservation of the old elite power and interests.”

The constitutional court defended its treatment of the national security adviser case, stressing that it had not yet made its decision or even set a date for a verdict.

The increasingly contentious role of bodies such as the Constitutional Court, the corruption commission and the national election commission goes to the heart of an eight-year on-off crisis that sets the traditional urban elite against rural voters loyal to Thaksin Shinawatra, the self-exiled plutocrat former premier and Ms Yingluck’s brother.

While Thailand is nominally a parliamentary democracy, it has been plagued by military coups for decades and still retains a prominent monarchy protected by lèse-majesté laws carrying jail terms of up to 15 years.

But the country’s historic balance of power has grown progressively more unstable amid social change, concerns over the succession to the near-68-year rule of the octogenarian King Bhumibol Adulyadej, and the destruction of the old establishment’s political hegemony by Mr Thaksin and his allies through a succession of election wins since 2001.

Additional reporting by Panvadee Uraisin

Copyright The Financial Times Limited 2018. All rights reserved.