At least three people have been killed, including a judge and a lawyer, and two wounded after a gunman opened fire in Milan’s Palace of Justice, officials said. The suspect was later arrested.

The alleged gunman was arrested in the town of Vimercate, 25 kilometers from Milan, and is currently being held at a police station, Interior Minister Angelino Alfano said on Twitter.

The suspect, identified as 46-years old Claudio Giardiello, is a defendant in a bankruptcy case, Italian press cited police as saying.

The gunman reportedly shot his lawyer, Lorenzo Alberto Claris Appiani, 37, and then shot in the direction of prosecutor Gaetano Ruta, but missed. Giardiello also allegedly killed his co-defendant before shooting dead judge Fernando Ciampi in a courtroom on another floor. Ciampi’s death was confirmed by Giovanni Canzio, the president of Milan’s Court of Appeal.

The whole attack was carried out with "cold premeditation," according to prosecutors, who said Giardiello fired at least 13 shots and had two spare cartridges for his weapon.

Catturato a Vimercate il presunto assassino di Milano. Ora si trova in caserma dei Carabinieri. — Angelino Alfano (@angealfa) April 9, 2015

A fourth victim of the massacre, believed to have been a witness, had no visible injuries and may have died of a heart attack.

The Palace of Justice was immediately evacuated as police feared the suspect may be still inside the building, said La Repubblica newspaper, adding that hundreds of people were seen outside the building.

"We barricaded ourselves under our desks because our office has glass walls, so we were worried because of that, we didn't know if the walls were bulletproof. After that, we stayed for five to six minutes and then we left as they told us to evacuate the building," court employee Maria Grazia Siclari told AP.

#Milano spari al Palazzo di Giustizia: "2 morti, 1 ferito" killer armato ancora dentro palazzo http://t.co/vETr3Jvc5epic.twitter.com/eDWKgn63sp — Corriere della Sera (@Corriereit) April 9, 2015

The incident took place at about 11 am local time, when witnesses reportedly heard four or five gunshots.

"I heard shots and saw a man with a bloody leg, I got scared and ran,” one witness told La Repubblica.

Giardiello left the scene and escaped from the court house on a motorcycle, the number plate of which was caught on video surveillance cameras. Police traced the attacker and arrested him in the town of Vimercate, Interior Minister Angelino Alfano said. The gunman "was ready to kill others in Vimercate," Alfano told journalists, partly confirming previous reports that Giardiello headed to the town to encounter another co-defendant, who was not present in the court.

#MILAN: Palace of Justice evacuated, hundreds of people seen outside building - local media http://t.co/SVQazSKXn8pic.twitter.com/nGNomYpbJE — RT (@RT_com) April 9, 2015

The armed attacker is believed to have used a fake ID to get into the court. He allegedly walked in through a side door with no metal detectors reserved for the court staff, Milan public prosecutor Edmondo Bruto Liberati said.

"It is shocking …and inconceivable that one can come into court with a weapon," said the president of the Lombardy Region, Roberto Maroni.

"Our task is to prevent this from happening again, and the one who made this mistake [of letting an armed person inside the building] must pay for it," Italian Prime Minister Matteo Renzi said at a press conference on Thursday, Sputnik news agency reported.