Zaghba, a 22-year-old with dual Moroccan-Italian nationality, was briefly detained after being stopped at the airport in Bologna, central Italy in March 2016.
Italian prosecutors were unable to bring charges against him for links to international terrorism and he was set free, a police spokesman told AFP.
Italy notified Britain and Morocco of his status as a potential Islamist radical.
But he never showed up on Britain's radar as someone capable of involvement in an attack like Saturday's, in which seven people were killed.
The three attackers smashed a van into pedestrians on London Bridge before going on a stabbing spree which ended with them being shot dead by police.
London's Metropolitan Police said Zaghba had not been on their radar before Saturday, despite the Italian warning. He was not a "police or (intelligence agency) MI5 subject of interest," a spokesman said.
RELATED READING
Third London attacker named by police
The mayor of Valsamoggia, a municipality near Bologna, said Zaghba was the son of an Italian mother, Valeria Collina, and a Moroccan father, Mohamed Zaghba, who had separated 18 months ago.
The son had been registered at an address in the village of Castello di Serravalle since 2004, as an Italian living overseas.
"In fact he never lived here," said the mayor, Daniele Ruscigno. "Only the mother lived here. She'd converted to Islam when she got married and neighbours say she wore a veil."
Neighbours told AFP the mother had moved back to the village, one of five that make up Valsamoggia, 18 months ago, living on the ground floor of a two-storey house in a leafy setting.
She owned the flat and her upstairs neighbour said she was "a very nice women, who never caused any trouble.
"I was flabbergasted when I heard what had happened," said Giulio Bortolini, 70.
Related reading
London and internet radicalised my son: attacker's mother
Italian passport
Zaghba had lived mainly in Morocco but had recently spent time working in Britain, most recently at a London restaurant.
He was intercepted at Bologna airport last year as he was about to board a plane for Turkey with security officials alerted by the fact that he was travelling with only a small backpack, his passport and a one-way ticket to Istanbul.
Italy's anti-terrorist police unit DIGOS believe he was trying to join Islamic State jihadists in Syria.
Police reportedly found IS propaganda videos on his cellphone, but after an investigation, they failed to find sufficient evidence of links to terrorism to justify prosecuting him.
Potentially crucially, a judge ordered that his computer be returned to him before its hard drive could be fully examined for further evidence of Islamist links.
As a holder of an Italian passport Zaghba was not liable for expulsion under the kind of administrative order Italy routinely uses against suspected Islamist militants from Morocco and Tunisia.
The Italian passport also meant he could easily travel to and from Britain.
The British and Moroccan authorities were notified of Zaghba's status by DIGOS. But he would have been among dozens of similar subjects notified to Italy's partners around the same time, so would not necessarily have stood out as a particular threat.
'No proof was terrorist'
"When he was stopped at the airport, he told the security agent that he wanted to be a terrorist, but then he withdrew that," said Bologna prosecutor Giuseppe Amato.
"His computer was seized but the court that reviewed the authorisation ordered it be handed back on the grounds there was no supporting evidence for the existence of a crime. So we were unable to fully examine it.
"He was notified to London as a possible suspect. In 18 months, he spent ten days in Italy and was always monitored by the Bologna DIGOS.
"We did everything we could but there was not sufficient basis to prove he was a terrorist, he was a suspect based on types of behaviour."
Zaghba was born in Fez, Morocco, in January 1995. He was reportedly estranged from his father and only saw his mother on his rare trips to Italy.
She was said to have told police last year that he had asked her for money to travel to Rome before he left on his attempted trip to Syria.