A trial defendant shot dead a judge and two others on Thursday on a rampage through a Milan courthouse, casting a harsh spotlight on public security measures that Italy tightened earlier this year.
Police said Claudio Giardiello shot the judge, Fernando Ciampi, in his office, having earlier opened fire in a courtroom killing a lawyer and his co-defendant in a bankruptcy trial. A fourth person was wounded.
In all, Giardiello fired 13 shots inside the Palace of Justice in central Milan before fleeing, police said. They arrested him in Vimercate, a town north of Italy's financial centre, Interior Minister Angelino Alfano said on his twitter feed.
Public security was tightened across Italy following January's Charlie Hebdo attacks in Paris, and it was not immediately clear how the assailant was able to carry a gun into the court buildings.
Milan chief prosecutor Edmondo Bruti Liberati told reporters the attacker likely carried a false identification badge and entered through a side entrance reserved for lawyers and court employees, where there is no metal detector.
Prime Minister Matteo Renzi said the priority was to ensure nothing similar ever happened again.
"We need to find out exactly what happened and above all how it was possible to take a firearm into a courthouse," he told a news conference in Rome.
"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 court buildings are just half a mile (1 km) from Milan's cathedral, its biggest tourist attraction. Police vans and an ambulance were parked outside the cordoned-off buildings and the street was closed to traffic.
The debate about security is also likely to focus on the Milan Expo opening on May 1. The city is hosting the global showcase of culture and technology, which will run for six months, for the first time in more than a hundred years.
Authorities said initial reports that a fourth person had been found dead in the court buildings were incorrect.
"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 for a legal office inside the court, said.