Authorities in Tunisia have arrested nearly two dozen suspects in connection with the March attack in which 21 tourists died, but Abdel Majid Touil, 22, was thought to be the first to be detained abroad.
Touil, who was wanted for premeditated murder, kidnapping and terrorism, according to the police, was detained on Tuesday evening by Italy's anti-terrorism DIGOS police in the northern town of Gaggiano.
He had arrived in Italy in February on a migrant boat and was living with his mother and two older brothers, who are legally resident in the town near Milan.
Police seized papers and USB flash drives from his house.
The attack on the Bardo National Museum on March 18th left 24 people dead: two gunmen, a Tunisian policeman and tourists from Italy, Japan, France, Spain, Colombia, Australia, Britain, Belgium, Poland and Russia.
Visitors getting off buses outside the museum were gunned down by two black-clad shooters with automatic weapons, who then took hostages inside the building.
Many people were shot in the back as they tried to escape. After rampaging through the museum for several hours, the gunmen were killed in an assault by security forces.
At the end of March, Tunisian forces killed nine suspected members of a jihadist group accused of being behind the shooting, the Okba Ibn Nafaa Brigade, including an Algerian who allegedly masterminded the attack.
'My brother is innocent'
Tunisia's President Beji Caid Essebsi said a few days after the shooting that a third gunman was on the run, but it later emerged that he may have been referring to an accomplice who was not at the scene.
The country's interior ministry told AFP on Wednesday it had "issued international arrest warrants for two Moroccans and an Algerian with an indirect link" to the attack, but did not specify if the man arrested in Italy was one of them.
The three men "did not take part in the terrorist operation but helped" the attackers, said ministry spokesman Mohamed Ali Aroui, who declined to give further details.
Police said Touil had been in Italy before the attack, after entering illegally in February with a boatload of 90 migrants.
DIGOS head Bruno Megale said Touil had been issued with an order to leave, but did not specify whether Touil had actually been expelled and, if so, where he had gone, leaving it unclear as to where he had been at the time of the attack.
Touil's brother told news agency Ansa that Touil had not left Italy since February.
"My brother is innocent, he has not committed any crime. He arrived on a boat like many others, and from that moment he did not leave again," he said.
A neighbour insisted that "he is a good boy. You are making a mistake, he has not done anything".
'Close the borders'
Tunisia has seen an upsurge in Islamic extremism since the overthrow of longtime strongman Zine El Abidine Ben Ali in 2011.
Authorities say as many as 3,000 Tunisians have gone to Iraq, Syria and Libya to join jihadist ranks, raising fears of returning militants plotting attacks.
Essebsi on Wednesday signed an agreement to boost security ties with the United States during a high-profile visit to Washington, which could see Tunisia net $62.5 million in military funding next year.
But in Italy, news that the shooting suspect had sneaked into the country by boat sparked an immediate outcry among right-wing politicians fearful a wave of migrants from North Africa could pose a new security threat.
The head of the anti-immigration Northern League party, Matteo Salvini, called for the Schengen agreement allowing free movement between most continental European states to be suspended.
"Libyan intelligence says boats are arriving with Islamic State terrorists. Today in my Milan a North African was arrested for involvement in the Tunisian massacre. Close the borders before it's too late," Salvini told Italian media.
Hard-right politician Daniela Santanche from Silvio Berlusconi's Go Italy party also slammed the government.
It is "unbelievable that this government, instead of defending us from cut-throats, has transformed Italy into a useful platform for terrorists," Santanche said.
Italian Prime Minister Matteo Renzi thanked the police on Twitter for capturing the suspect, but was inundated by demands to explain the affair to parliament, while Interior Minister Angelino Alfano faced calls to resign.