Tens of thousands of people gather in central Grozny, capital of Russia's North Caucasus region of Chechnya, on Jan. 22, 2016, for a mass state-sponsored demonstration in support of strongman leader Ramzan Kadyrov. Elena Fitkulina/AFP/Getty Images

MOSCOW — A Russian court Thursday sentenced two Ukrainians to at least 20 years each in jail for allegedly fighting alongside Chechen rebels against Russian troops in the 1990s. Ukraine considers Stanislav Klikh, who was given 20 years behind bars, and Nikolai Karpyukh, who received 22 and a half years, political prisoners and has demanded their release.

The decision by the court in the Chechen capital of Grozny comes a day after Ukrainian pilot Nadezhda Savchenko, sentenced to 20 years in prison by a Russian court last month, was returned to Kiev as part of a prisoner swap for two alleged Russian intelligence officers.

Klikh and Karpyukh deny ever setting foot in Russia's southern republic of Chechnya and allege they were tortured in a long period of incarceration, during which their families did not know their whereabouts, after their arrest by Russian intelligence agents in 2014.

“The Ukrainian president and the Ukrainian authorities will try and resolve this through negotiations like with Savchenko,” Ilya Novikov, a lawyer for Klikh who also defended Savchenko, told International Business Times.

Screen Shot 2016-05-26 at 19
Nikolai Karpyukh, accused of killing Russian soldiers in 1994, shown during his trial in the Chechen capital of Grozny, May 17, 2016. Anton Naumlyuk

The two men were convicted by a jury earlier this week based on confessions they later withdrew and on evidence given by Alexander Malofeyev, a Ukrainian national reportedly covered in Nazi tattoos with several chronic diseases who is serving a sentence of over 35 years in a Russian prison.

“Everything that is in this criminal case is built on me being forced to slander myself. Why do you need facts and proof when there are electric shocks?” Karpyukh said during his final statement to the court earlier this month, according to a report by Radio Liberty.

Karpyukh and Klikh were tortured by electric shocks on their hands, feet and genitals, being hung from handcuffs and by enduring long periods of solitary confinement, according to their lawyers.

Russian prosecutors accused the two men of being part of a group of Ukrainian nationalists, known as the Vikings, who fought in Grozny in 1994 against Russian soldiers during a bloody separatist war that engulfed the region after the fall of the Soviet Union.

Klikh worked as a history teacher in Ukraine before his arrest, while Karpyukh, who has a wife and a nine-year old son, was a member of the extreme Ukrainian nationalist organization Right Sector.

Ukrainian President Petro Poroshenko makes a statement with Ukrainian servicewoman Nadezhda Savchenko in Kiev, May 25, 2016. Reuters

Klikh’s behavior has become increasingly erratic during the court proceedings, and there are fears his mental health has suffered. “Klikh conducts himself very strangely, as if he is a very ill person,” lawyer Novikov said. Experts appointed by the court said Klikh was fit to stand trial.

Evidence given by Klikh and Karpyukh was reportedly used last year by top Russian investigators to accuse Ukrainian officials, including then-Prime Minister Arseny Yatsenyuk, of fighting in Chechnya.

The two men are among a group of Ukrainian nationals, including Savchenko, who have been sentenced to long prison sentences in Russia in what Kiev says are political decisions. There was a collapse in relations between Ukraine and Russia in 2014 after the toppling of a pro-Russian government, which was then followed by the Kremlin’s annexation of Crimea and military support for anti-Kiev rebels in the east of Ukraine.

Ukrainian film director Oleg Sentsov was sentenced by Russia to 20 years in prison in August on terrorism charges, and Ukrainian pensioner Yuri Soloshenko, a 73-year-old reportedly suffering from cancer, was sentenced to six years in prison in October on spying charges.