A defendant in a fraudulent bankruptcy trial went on a rampage and killed three people, including a judge, in an Italian courthouse on Thursday.

Fernando Ciampi, the judge, was killed by alleged shooter Claudio Giardiello, 57, in his office, according to ReutersPrior to that, police said Giardiello killed a lawyer, Lorenzo Alberto Claris Appiani, and Giorgio Erba, his co-defendant in the fraudulent bankruptcy case, in a courtroom at Milan's Palace of Justice.

Altogether, Giardiello fired his gun 13 times before leaving the scene. He was arrested by authorities in Vimercate, Italian Interior Minister Angelino Alfano announced on Twitter.

According to The Guardian, Giardiello had an explanation for the shooting spree.

"I wanted to take revenge on those who ruined me," he said.

"I heard a series of shots, I threw myself in the first office I could find and I thought I was going to have a panic attack," Massimilano Monti, who works inside the courthouse, said.

Milan chief prosecutor Edmondo Bruti Liberati said that the attacker bypased metal detectors by enter ting the courthouse through the employee entrance with a fake ID badge.

"We need to find out exactly what happened and above all how it was possible to take a firearm into a courthouse," Prime Minister Matteo Renzi said. "This is not the first time this has happened but obviously it must be the last. The government has given a powerful mandate to expose the systemic failings which evidently happened."

The tragedy took place just three months after Italy took increased security in the wake of Paris' Charlie Hebdo attacks.