Vyacheslav Zaitsev, 19, admitted his guilt and was also fined, the city's court press service said.

Russian officials have linked pro-Ukrainian sabotage groups with numerous attacks on railways aimed at disrupting supplies to the war front in Ukraine since Moscow's full-scale invasion began nearly two years ago.

Ukraine's domestic spy agency has also been accused of detonating explosives on railway lines inside Russia.

Zaitsev was found to have set fire last March to a railway box housing signalling and communications gear on a stretch of track south of St Petersburg, Russia's second-largest city, with the intent to "undermine the economic security and defense capability of the Russian Federation," the court said.

He acted at the behest of a "handler" whom he met on the Telegram messaging app and who paid him 10,000 rubles in cryptocurrency for committing the crime, according to the court.

Last summer, a military court sentenced a dual Russian-Ukrainian citizen to 22 years for blowing up rail track in southern Russia on the instructions of Ukraine.

(Reporting by Lucy Papachristou; Editing by Mark Trevelyan)