On Thursday, voting was underway in Thailand’s parliament for a new prime minister, with Move Forward Party leader Pita Limjaroenrat running unopposed in what will be a critical test of his political clout. The 42-year-old, U.S.-educated liberal, whose movement stunned establishment rivals to win May’s election, faces a significant challenge in securing the required backing of more than half of the 749-member bicameral parliament. He will need to clinch the support of 375 MPs in the lower House and 250 members of the military-appointed Senate.

He will face a tough battle in the Senate, where many lawmakers oppose his party’s anti-establishment agenda, including a controversial plan to amend a law criminalizing defamation of the king and royal family. Move Forward drew young voters with its pledge to change the lese majeste law, one of the world’s harshest. It also seeks to lessen the military’s influence and end business monopolies.

A legal complaint lodged on the eve of the vote against Pita and his coalition partner Pheu Thai, linked to exiled former leader Thaksin Shinawatra, could further complicate matters. The Constitutional Court is investigating whether his campaign violated a ban on party leaders owning media shares, which could lead to their disqualification from parliament. The allegations against him also resemble the case filed against his predecessor as leader of the then-Future Forward Party, Thanathorn Juangrungruangkit, who was found guilty of holding media shares and later disqualified from parliament.

Despite the hurdles, Pita was confident he could secure the votes needed for his nomination. His party spokesman Rangsiman Rome implored the public to turn out and “show that Thai society is ready to give a new start.” Outside parliament, police dropped dozens of shipping containers as barricades and rolled out razor wire in preparation for possible protests.

Ken Lohatepanont, a political commentator, said the legal challenges against Pita would unlikely shift his prospects for the premiership. “Senators who were going to vote for him based on arguments about democratic legitimacy are likely to do so. Senators who did not want to vote for him will have a new justification for abstaining,” he said. Regardless of the outcome of the vote, the process will drag on for weeks. A long impasse will allow conservative rivals to retain their hold on power and potentially rip apart the pro-democracy camp. It would be a significant setback to the country’s fragile democracy and could open the door for a return to authoritarian rule.