The suspect - 24-year-old Tunisian Anis Amri - traveled to Italy from Germany via France, taking advantage of Europe's open-border Schengen pact to cross the continent undetected.
As anger grew over the fact that Amri had escaped expulsion twice in 18 months thanks to bureaucratic loopholes, euroskeptic parties called for the reintroduction of border controls, while Germany said deportations had to be made easier.
Amri is suspected of ploughing a truck through a festive Berlin market on Monday, killing 12 people. In a video released on Friday after his death, he is seen pledging his allegiance to militant group Islamic State leader Abu Bakr al-Baghdadi.
"I call on my Muslim brothers everywhere... Those in Europe, kill the crusader pigs, each person to their own ability," he says in the video posted on Islamic State's Amaq news agency.
Amri had arrived in Milan's main railway station from France at 1.00 a.m. (2000 EDT) and then traveled to the working class suburb of Sesto San Giovanni, where two young policemen approached him because he looked suspicious idling on a street.
Milan police chief Antonio De Iesu told a news conference his men had no idea that they might be dealing with Amri.
"They had no perception that it could be him, otherwise they would have been much more cautious," De Iesu said. "We had no intelligence that he could be in Milan."
He failed to produce any identification so the police requested he empty his pockets and his small backpack. He pulled a loaded gun from his bag and shot at one of the men, lightly wounding him in the shoulder.
Amri then hid behind a nearby car but the other police officer managed to shoot him once or twice, killing him on the spot, De Iesu said. Amri was identified by his fingerprints.
De Iesu said that besides the gun, the suspect had been carrying a small pocket knife. He also had a few hundred euros on him but no cell phone and very few other belongings.
Amri once spent four years in jail in Italy and police were trying to work out if he knew someone in Sesto, which is home to a sizeable Muslim community. "He could have carried out other attacks. He was a loose cannon," De Iesu said.
Islamic State had previously claimed responsibility for the Berlin killings and on Friday it acknowledged the death of the man it referred to as "the executor of the Berlin attacks."
Leading euroskeptics were quick to blame the Schengen open borders pact for allowing the suspect to travel so easily.
"This escapade in at least two or three countries is symptomatic of the total security catastrophe that is the Schengen agreement," said Marine Le Pen, who leads France's far-right National Front party and is running for president.
Beppe Grillo, the founder of the 5-Star Movement, Italy's main opposition party, said Schengen was allowing militants to cross Europe with impunity and had to be re-thought. He also said all illegal migrants had to be expelled from the country.
Chancellor Angela Merkel, under increasing pressure inside Germany to take a much tougher line on immigration after opening the country's borders to waves of refugees in 2015, said the Berlin attack raised many questions and promised measures would be taken to improve security.
Amri originally come to Europe in 2011, reaching the Italian island of Lampedusa by boat. He told authorities he was a minor, though documents now indicate he was not, and he was transferred to Catania, Sicily, where he was enrolled in school.
Just months later he was arrested by police after he attempted to set fire to the school, a senior police source said. He was later convicted of vandalism, threats, and theft.
He spent almost four years in Italian prisons before being ordered out of the country after Tunisia refused to accept him back in 2015 because he had no identification papers linking him to the north African country.
He moved to Germany and applied for asylum there, but this was rejected after he was identified by security agencies as a potential threat. Once again he could not be deported because of a lack of I.D.
Merkel said on Friday she had told Tunisian President Beji Caid Essebsi during a phone conversation that her government wanted to speed up deportation of failed asylum seekers.
The attack, which echoed one in Nice in July that killed more than 80 people, has put Europe on high alert over the Christmas period.
Early on Friday, German special forces arrested two men suspected of planning an attack on a shopping mall in the western city of Oberhausen.
The men - two brothers from Kosovo, aged 28 and 31 - were arrested in the city of Duisburg on information from security sources, police said. A police spokesman said there was no link with the Amri case.
Banner/thumbnail credit: REUTERS/Stringer