Italian police on Friday shot dead the prime suspect in the Berlin Christmas market attack, ending a frantic four-day hunt for Europes most-wanted man.
Tunisian Anis Amri, 24, is believed to have hijacked a truck and used it to mow down holiday revellers at the market on Monday, killing 12 and wounding dozens more.
The Islamic State jihadist group has claimed responsibility and released a video Friday in which Amri is shown pledging allegiance to IS chief Abu Bakr al-Baghdadi.
He had been missing since escaping after the attack Monday, but his time on the run was cut short thanks to a combination of luck and the quick reflexes of rookie police officer Luca Scata.
The 29-year-old, still officially a trainee, shot the Tunisian twice after he had fired on his patrol partner, Christian Movio, 36.
The officers had stopped Amri in the early hours of Friday, near Milan's Sesto San Giovanni train station. They had no idea of who they were dealing with.
"He was completely calm, they asked him to empty his backpack and with a sudden movement he pulled out the pistol, which was loaded and ready to use," said Roberto Guida, the neighbourhood police head.
Police said Amri had initially tried to pass himself off as being from southern Italy and had shouted "bastard police" in Italian before opening fire.
Chancellor Angela Merkel welcomed the news, saying: "We can be relieved at the end of this week that the acute danger is over.
"However the danger of terrorism in general endures, as it has for several years. We all know that."
Amri's death came as German police arrested two brothers on suspicion of planning to attack a shopping mall, while authorities in both Australia and Indonesia reported that Christmas terror plots had been foiled.
Amri's port of entry to Europe was Italy, arriving on a migrant boat in 2011, and spending four years in prison there afterwards.
Convicted for starting a fire in a refugee centre, he served out his sentence until 2015, then made his way to Germany, taking advantage of continental Europe's Schengen system of open borders -- as he did on his return to Italy this week.
Milan police chief Antonio De Iesu said Amri had arrived in Italy from Germany via France. He had no telephone on him and only a few hundred euros.
German police said they found his finger prints in the truck, next to the body of its registered Polish driver, who was killed with a gunshot to the head.
A 100,000-euro ($104,000) reward had been offered for information leading to Amri's arrest.
Prominent politicians in Germany and Italy warned that lessons had to be learned from mistakes that might have contributed to Amri being able to carry out his attack.
The Tunisian was a rejected asylum seeker and had been on the radar of anti-terrorism agencies in both countries following his apparent radicalisation in prison.
German news weekly Der Spiegel reported that in wiretaps, Amri could be heard offering to carry out a suicide operation, but that his words were too vague for an arrest warrant.
Amri had been monitored since March, suspected of planning break-ins to raise cash for automatic weapons to carry out an attack -- but the surveillance was stopped in September because Amri was seen primarily as a small-time drug dealer.
Conservative lawmaker Stephan Mayer, a critic of Merkel's liberal stance on refugees, said the case "held up a magnifying glass" to the failings of her migration policy that brought almost 900,000 asylum seekers to Europe's top economy last year.
"It's clear that a lot went wrong... it was a systemic failure," said Peter Neumann, professor of security studies at King's College London.
Beppe Grillo, leader of Italy's biggest opposition party, the Five Star Movement, said the Schengen open borders system should have been suspended after the attack and needed an overhaul.
"Italy is becoming a crossroads for terrorists that we are not able to identify and alert people about, and they are able to spread all over Europe thanks to Schengen," he said.
"Those entitled to asylum in Italy can stay, but all the other illegals need to be repatriated immediately, starting from today."
Germany's government has urged its citizens not to give in to fear, and Berliners flocked back to the Breitscheid square market after its reopening on Thursday.
On Friday, a memorial concert was planned at the iconic Brandenburg gate under the theme of "Together Berlin".
Italian Prime Minister Paolo Gentiloni praised the police duo whose overnight patrol ended an international manhunt.
Prime Minister Paolo Gentiloni said: "Italy can be really proud of these two officers.
"We remain on maximum alert, we will not underestimate the threat but what happened overnight shows citizens that the state is there for them."
Movio, the officer shot by Amri, underwent successful surgery to repair the damage to his shoulder later Friday and was able to joke with visitors to his hospital bed. "I'm happy to have been useful," he told one.