A Russian court on Thursday jailed a teenaged supporter of the Islamic State jihadist group over a plot to carry out a suicide attack at Saint Petersburg's Kazan cathedral, a key tourist attraction.

The military district court sentenced 18-year-old Yevgeny Yefimov to serve five years in a strict-regime penal colony, RIA Novosti news agency reported.

The Russian security service said in December 2017 it had broken up an IS cell that was plotting to stage the attack later that month, with President Vladimir Putin thanking his US counterpart Donald Trump for assistance in the case.

Putin said the CIA had provided intelligence on two plotters.

Yefimov, a slight youth, was teaching English at a private school at the time he was detained in December.

He had rented a shipping container in the centre of Saint Petersburg where investigators found chemicals and equipment used to make explosives.

The massive early 19th-century cathedral, modelled after St Peter's Basilica at the Vatican, is located on the city's main thoroughfare, Nevsky Prospekt.

Yefimov told the court he had been in touch with IS fighters in Syria who encouraged him to carry out an attack and he planned to blow himself up during a religious service.

He said he had since changed his views and was glad his attempt to make explosives failed.

Asking for forgiveness in court, he said he planned to spend his prison time studying.

Russia has already jailed two men for failing to report the plotters while having "credible information" and for possessing illegal weapons.