Call it Thaksin’s revenge. The shock announcement on Friday that a senior royal is running for prime minister has electrified Thai politics. It is a shot in the arm for a moribund democracy suffocated by authoritarian rule. It wrecks the traditional separation of crown and government. And it means next month’s election may prove a genuine contest, not merely a joyless coronation of Prayut Chan-o-cha, leader of the military junta.

Yet most telling is the fact that the nomination of Ubolratana Rajakanya Sirivadhana Barnavadi, elder sister of King Maha Vajiralongkorn, was put forward by the Thai Raksa Chart party. The party is closely allied to Thaksin Shinawatra and his sister, Yingluck Shinawatra, both former prime ministers ousted in military coups in 2006 and 2014 respectively, the latter led by Prayut.

Ubolratana is everything Prayut is not. She carries the allure of the royal family, the most revered Thai institution. Her father, King Bhumibol Adulyadej, known as Bhumibol the Great, was the object of national adoration and at the time of his death in 2016 was the world’s longest-serving head of state. Although Ubolratana has renounced her royal titles, she retains Diana-like star quality – enhanced by past film roles and a soi-disant “people’s princess” image.

Prayut, in sharp contrast, is a domineering, splenetic character – an autocratic former general who since he seized power has repressed the naturally rambunctious instincts of Thai politics and society in the self-serving cause of stability. The National Council for Peace and Order (NCPO), the junta’s official name, has been promising, and delaying, to hold fresh polls ever since it ousted the elected government five years ago.

The 2017 constitution, created under Prayut, gives him, as prime minister, absolute power without oversight or accountability. The most recent report by Human Rights Watch accused the regime of complicity in unlawful detentions, enforced disappearances, torture and other abuses, notably in mostly Muslim, southern provinces affected by separatist unrest.

Challenging Prayut is a risky business at any time, and existing regulations could compromise a free and fair election. “Media outlets face intimidation, punishment, and closure if they publicise commentaries critical of the junta and the monarchy, or raise issues the NCPO considers to be sensitive to national security, including the repression of basic rights,” Human Rights Watch said.

Despite his grim record, Prayut had been widely expected to win next month’s election, if only due to the lack of a credible challenger. All that has changed with Ubolratana’s candidacy – and her backing by Raksa Chart, a spin-off from Thaksin’s Pheu Thai party. Although Thaksin has mostly lived in exile since 2006, he is still said to exercise considerable influence. Co-opting a popular princess looks like a masterstroke.

The sense that it’s payback time for Prayut is increased by the prospect of Ubolratana gaining support from supporters of the United Front for Democracy Against Dictatorship, the predominantly rural, working-class “red shirt” populist movement that propelled Thaksin and his sister to power.

Their traditional opponents are often defined as the mostly urban, military-royalist “elite”. That alliance has been split down the middle by Ubolratana’s bombshell announcement.

It remains possible Prayut’s backers could mount a legal challenge to Ubolratana’s candidacy by claiming she is violating laws designed to keep the monarchy out of politics. Prayut could even postpone the election, as has happened in the past, on grounds of national security, especially if there is a return to unruly street demonstrations during the campaign.

Ubolratana’s dream of power could even be thwarted by her younger brother, before it gets off the ground. In an official statement late on Friday, the king declared her candidacy to be “inappropriate” and “unconstitutional”. If that is the final word from the palace, the princess will probably have no choice but to step down – making hers the shortest-lived premiership bid in Thai history.