More than 30 Besiktas supporters face charges described by rights groups as an abuse of justice by vengeful government.

Turkish football fans protest outside the Istanbul court where 35 Besiktas supporters are on trial for an alleged attempted coup. Photograph: Ozan Kose/AFP/Getty Images

Thirty-five Turkish football fans have gone on trial accused of attempting to stage a coup during mass protests last year, in a case that the political opposition and rights groups say is an abuse of the justice system by a government bent on revenge.

Prosecutors are seeking life sentences for the supporters of the Istanbul team Besiktas. They are accused of helping organise the protests that erupted in Istanbul’s Taksim Square in May 2013 and grew into a major challenge to the then prime minister, Recep Tayyip Erdoğan.

Erdoğan, who won the presidential election in August, has vowed to hunt down the “traitors” behind the protests and a corruption scandal that emerged just over six months later. He has cast both incidents as an orchestrated bid to topple him.

The trial began two days after Turkey drew international criticism for the police detention of prominent media figures in what Erdoğan said was a response to “dirty operations” by his political enemies.

The indictment accuses the Besiktas supporters of seeking to occupy Erdoğan’s Istanbul office near the team’s stadium “to create the appearance that a weakness of authority had emerged in the country”, and of drawing foreign media to the protest areas.

“They tried to create an image evoking government changes in some Middle Eastern countries known as the Arab spring and aimed to overthrow the legally established government of the Turkish republic using illegal methods,” the indictment said.

The “Carsi” supporters group played a prominent role in the protests, which drew a diverse crowd of hundreds of thousands across Turkey. An anti-police slogan chanted at matches rang out regularly and at one point Carsi members commandeered a mechanical digger and drove it towards police lines.

The unrest began as a peaceful protest against the demolition of Gezi Park, a leafy corner of Taksim, but spread nationwide after a brutal police crackdown in which at least six protesters and one officer died. Prosecutors have since launched a series of court cases against those involved.

“The makeup of the AK party government has run and its true face has emerged. The Carsi trial is the revenge for Gezi,” said Umut Oran, an Istanbul MP for the main opposition CHP, whose members ripped up a copy of the indictment outside the court on Tuesday.

Government officials have repeatedly said the judiciary is independent. In their indictment, prosecutors cited the seizure of gas masks, flares and handguns as evidence against the soccer fans. They also cited payment arranged by one defendant for meatballs and pizza “for individuals in the protest area”.

“This is the world’s funniest court case where a football fan group is accused of trying to stage a coup to overthrow the government. Of course this has no logic,” the prominent journalist and Besiktas fan Ridvan Akar said.

Hundreds of police, backed by water cannon trucks, imposed tight security at Istanbul’s palace of justice as the case began.

“Shoulder-to-shoulder against fascism,” chanted hundreds of soccer fans, some from rival clubs. A few lit flares and some held up banners, one reading: “Carsi will never walk alone.” Trade unionists, politicians and activists were among the crowd.

The advocacy group Human Rights Watch said the prosecution was a “blatant misuse of the criminal justice system”.