Former Russian prison service official Viktor Sviridov.
Moscow CNN  — 

A former Russian prison service official died by suicide in a Moscow court on Wednesday after he was sentenced to three years in jail, Russian state news agency TASS reported.

Moments after the judge found him guilty, Viktor Sviridov, the former chief of Russia’s federal penitentiary service’s motor transport department, took out a pistol and shot himself.

“After the guilty verdict was handed down, Sviridov committed suicide. He died on the spot,” the emergency services told TASS.

An ambulance at Moscow's Chertanovsky District Court, where Viktor Sviridov died by suicide.

The 71-year-old had been convicted of extorting 10 million rubles ($158,500) from the former deputy director of the penitentiary service, Alexander Sapozhnikov, according to Russian media.

Sviridov’s lawyer, Alexander Kotelnitsky, told TASS that his client had stage four cancer, but did not appear to be in a depressed mood when he went into court Wednesday morning.

Sviridov had been under travel restrictions since his indictment.

Authorities are investigating how Sviridov was able to carry a weapon into the courtroom, the court press service said. TASS reported that the metal detectors in the court were in good, working condition.

CNN has reached out to the court for comment.