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.

Sviridov had been convicted of extorting 10 million rubles ($158,500) by Moscow’s Chertanovsky Court.

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.