Tens of thousands of people have protested in the Turkish capital, Ankara, against a court case that could oust the head of the main opposition on Monday after a year-long legal crackdown on hundreds of its members.

Live footage showed crowds chanting for President Recep Tayyip Erdoğan’s resignation while waving Turkish flags and party banners.

The court decision on Monday whether to invalidate the 2023 congress of the Republican People’s party (CHP) over alleged procedural irregularities could reshape the party, rattle financial markets and influence the timing of a general election set for 2028. The court could also delay the ruling.

Speaking at Sunday’s rally, the CHP leader, Özgür Özel, said the government was trying to cling to power by undermining democratic norms and suppressing dissent after opposition victories in local elections over the past year.

Özel also called for a snap general election. “This case is political. The accusations are slander. Our comrades are innocent. What’s being done is a coup – a coup against the future president, against the future government. We will resist, we will resist, we will resist,” he said in his address to the crowd.

The government says the judiciary is independent and denies any political motives.

Turkey has detained more than 500 people, including 17 mayors, over the last year in Istanbul and other CHP-run municipalities around the country as part of corruption investigations, according to a Reuters review.