Police in Italy said Thursday they had arrested a 37-year-old Algerian man in the Milan subway, later discovering he was wanted by that country for alleged ties to Islamic State.
When stopped by police officers for a routine check, the man became "particularly aggressive", said police in Milan, who added the arrest took place "in recent days".
He was "repeatedly shouting 'Allahu Akbar' while attempting to grab from his backpack an object that turned out to be a knife with a blade more than 12cm (nearly five inches) long," they said in a statement.
The man was later found to be wanted by authorities in Algeria, suspected since 2015 of belonging to "Islamic State militias and employed in the Syrian-Iraqi theatre of war," police said.
Police said the suspect was unknown to Italian authorities.
The man is currently in Milan's San Vittore prison and awaiting extradition, they added.
Jihadist group IS proclaimed a "caliphate" in 2014 across swathes of Syria and Iraq, launching a reign of terror that continues with hit-and-run attacks and ambushes.