THE latest episode in Russia’s long history of judicial travesties played out this week in a stuffy courtroom in Rostov-on-Don, a provincial city near the Ukrainian border. As two defendants sat in a cage behind their lawyers, a prosecutor in dark glasses described them as bloodthirsty Ukrainian radicals who ran a terrorist cell in Crimea in early 2014. They had allegedly plotted to blow up a statue of Lenin.

The lead defendant is Oleg Sentsov (pictured), a Ukrainian film director, and the supposed terrorist plot is every bit as fictional as his screenplays. Mr Sentsov’s real offence was to oppose Russia’s annexation of his native Crimea, helping deliver food to Ukrainian soldiers trapped on their bases after the Russian invasion. After his arrest, Mr Sentsov says, he was tortured by Russia’s Federal Security Service (FSB). (The prosecution claims his injuries came from sadomasochistic sex.) Mr Sentsov faces a potential life sentence. Dmitry Dinze, his lawyer, estimates his chance of acquittal at “none”.

Mr Sentsov is only the tip of the iceberg. The Ukrainian government says that at least ten of its citizens are political prisoners in Russia. Apart from Mr Sentsov, the best-known is Nadia Savchenko, a Ukrainian helicopter pilot captured during fighting in eastern Ukraine and transferred to Russian custody. Russia claims she crossed the border voluntarily, and accuses her of involvement in the deaths of two Russian journalists in eastern Ukraine, an indictment her lawyers call Kafkaesque.

The Ukrainian cases appal Russian human-rights activists. “There’s a sense that [security officials] have permission,” says Zoia Svetova, a liberal journalist and member of a public prison oversight council. Many wonder what would happen if the FSB were to turn on internal enemies with a similar vindictiveness and impunity. Alexander Popkov, a lawyer for one of the Ukrainian defendants, invokes Stalin’s purges: “We haven’t reached 1937 yet, but we’re surely moving in that direction.”

For the rest of the world, meanwhile, the concern is that Russia’s abusive legal system is spilling across its borders. The government’s legal oppression of Russians has become familiar enough over the years. But the trumped-up prosecutions of Ukrainians (and of Eston Kohver, an Estonian security services officer seized by Russian border guards in September) suggest that citizens of neighbouring countries are now at risk as well.

For Ukrainians, simple business trips can become nightmares. Yuri Yatsenko, a 23-year-old law student from Lviv, set out with a friend for Russia last May, planning to buy cheap electronics to sell back home. It took a year for him to get home. After detaining Mr Yatsenko for visa violations, Russian agents took an interest in his western Ukrainian background. They asked him to appear on television and say that he had been sent as a saboteur by Right Sector, a Ukrainian nationalist group. Mr Yatsenko refused. He was jailed, prevented from sleeping for days on end, and denied contact with relatives, lawyers and Ukrainian consuls. “They made it clear that no one could help me,” Mr Yatsenko says. He eventually managed to pass a message through a cellmate to a friend back home, who arranged for a lawyer to take up his case. The next day, Mr Yatsenko says, FSB agents handcuffed him, drove him out of town, beat him up and “threatened to chop me to pieces”. Afterwards he slashed his abdomen and wrist with a razor blade, hoping self-inflicted injuries might excuse him from another beating. For months Mr Yatsenko bounced around detention centres, spending a three-month stretch in solitary confinement. In May 2015 a court convicted him for possession of explosives, said that he had served his time, and unexpectedly sent him back to Ukraine. “I was the happiest man in the world,” he says. Others have not been as lucky. Yuri Soloshenko, a 73-year-old charged with espionage, has been held for more than a year at Lefortovo, once the main prison of Stalin’s secret services. Two Ukrainian men arrested last year, Stanislav Klikh and Mykola Karpyuk, have been accused of fighting alongside Chechen rebels some 20 years ago. Mr Klikh, who is being held in the North Caucasus, claims he has never been to Chechnya, and says he was tortured into confessing. Mr Karpyuk (who is, in fact, a Ukrainian nationalist) has not surfaced since his arrest. To judge by Mr Sentsov’s prosecution, the Ukrainian cases are largely political fabrications. The only evidence directly linking him to the alleged plot is the testimony of two “co-conspirators”. One, a self-styled radical with a history of psychological problems, accepted a reduced sentence in exchange for testifying. The second retracted his testimony in court last week, saying he too had been tortured.

It is the fabricated, political nature of Russian justice that makes it dangerous. Soldiers such as Ms Savchenko are treated as terrorists rather than prisoners of war because Russia claims not to be at war in Ukraine. Citizens such as Mr Yatsenko are arrested to pressure them into spouting anti-Ukrainian propaganda on television. For the Kremlin, courts are instruments of political fiction, not justice. And this abuse of the law in the service of propaganda is spreading far beyond its own borders.

Within Russia, few question the official version of events—but some do. Natasha Josef, a Russian documentary-maker, has organised screenings of Mr Sentsov’s film “Gámer” and corresponded with him during his detention in Lefortovo. “When he was arrested,” Ms Josef says, “I understood that anyone could be put in jail.”