Three men in Kazakhstan have received long prison sentences on terrorism charges at the end of an ill-tempered trial that supporters of the accused say was unjust and politically motivated.

Rights campaigners have been spiritedly arguing that the real spark for this and concurrent trials was the defendants’ criticism of long-serving, 78-year-old President Nursultan Nazarbayev.

Lawyer Gulnara Zhuaspayeva, who acted for the defense, wrote on her Facebook page that Almat Zhumagulov and Oralbek Omyrov were each sentenced to eight years in jail on charges of advocating terrorism. Another defendant, Kenzhebek Abishev, received a seven-year prison term.

The men vehemently denied the charges, which were heavily reliant on almost comically amateurish video evidence showing three masked, self-styled militants threatening Kazakhstan with violent jihad. Even prosecutors conceded that none of the trio shown in that section of the footage were among the accused. They instead sought to link the defendants to the would-be jihadis by means of tortured circumstantial evidence.

It is unknown what efforts were undertaken by the authorities to identify the masked men, but none have ever been taken into custody.

The trial, which was held in the city of Almaty, unfolded in an air of general chaos and was marked by moments of intense drama. At one stage, two of the defendants self-mutilated and harangued the judge about what they described as unfair proceedings as blood poured down their arms. Supporters of the accused also claimed that they had been subjected to physical mistreatment in prison.

Further muddying the waters in this case, suspicions were voiced among some watching it closely that one of the defendants, Omyrov, may in fact have been a security services plant. He was not previously well-known to the political discussion circle of government opponents to which Zhumagulov and Abishev belonged.

The common thread between this and other trials that have taken place in the past weeks and months is that all those in the dock have in some way been linked to the Democratic Choice of Kazakhstan, or DVK, a banned political group created by exiled opposition figure and disgraced banker Mukhtar Ablyazov.

Last month, a man was given a four-year jail sentence for posting DVK content on Facebook — an act that prosecutors deemed tantamount to providing the group with material support.

The government is making increasing use of extremism legislation to silence dissident voices. A court in Astana in March ruled to designate DVK an extremist organization, in effect likening it to a terrorist group. That has left anybody posting material expressing solidarity with the group and its aims at risk of prosecution under severely punitive legislation.

Describing this now-concluded trial some weeks ago, respected rights activist Yevgeniy Zhovtis remarked that the so-called “jihadi” trial was nothing more than “a selective approach against dissidents under the noisy name of fighting terrorism and extremism.”