A Moroccan national accused by Tunisian authorities of supplying weapons in the Bardo Museum massacre earlier this year will be deported from Italy, police said on Wednesday.
"Abdel Majid Touil is in Italy without a regular permit of stay so an expulsion order has been issued against him," said a police statement.
"He will be held in a centre for identification and expulsion (CIE) in Turin until he is expelled," the statement added
Earlier on Wednesday a Milan court rejected a request from Tunisia to extradite 22-year-old Touil because he could be executed there if he is convicted of involvement in the Bardo attack.
Italy refuses to extradite suspects to any country if there is a risk they could be put to death for the crime.
The court also ordered Touil's release from Milan's Opera jail and prosecutors requested the investigation against him be shelved due to a lack of evidence.
He was arrested near Milan on 19 May by Italian counter-terrorism police on an international warrant issued by Tunisia.
Touil arrived in southern Italy in mid-February on a migrant boat and has never left the country since, according to Touil and his family, who deny his involvement in the Bardo attack.
He had been ordered to leave Italy within eight days after he arrived at the Sicilian port of Porto Empedocle on 17 February but failed to comply.
Twenty-one foreign tourists, a policemen, and two out of three gunmen were killed during the 18 March assault on the Bardo museum in Tunis, which was claimed by the Islamic State militant group.