In the winter of 2015 I began investigating a group of young British Muslims from Brighton who left the south coast to fight in Syria. I wanted to discover how and why three brothers, Abdullah, Jaffa and Amer Deghayes, chose to join Jabhat al-Nusra, the Syrian affiliate of al-Qaida, once the most powerful Islamist group fighting the forces of Bashar al-Assad. The project soon became my first exposure to the world of Libyan extremist politics and the influence it exerted over young men growing up in places such as Brighton and Manchester.

The remarkable narrative that unfolded through detailed testimony from family, friends, police, social services and counterterrorism officials seemed to offer a sequence of facts that would probably never be repeated. That was until Manchester.

It should be said that while the Deghayes brothers opted for al-Qaida’s branch of extremism and detested Islamic State, where Salman Abedi’s allegiance appeared to lie, they never displayed any intention to attack the west. But the similarities, including a shared Libyan axis, angst over the killing of Muslim children in Syria, issues with identity and a wayward hedonistic adolescence that became an increasingly pious outlook undoubtedly suggest a pattern.

Abedi and the Deghayes brothers had Libyan parents with strong connections to the capital Tripoli. Both families had fled persecution by the dictator Colonel Gaddafi. The father of Abedi, Ramadan, fought with the Libyan Islamic Fighting Froup (LIFG) against the Gaddafi regime during the Libyan revolution in 2011.

The uncle of the Deghayes boys, Omer, was also linked to LIFG, an outlawed group that the US state department says has links with al-Qaida. Omer would be detained at Guantánamo Bay from 2002-2007 and interrogated over “general-to-specific information on LIFG personalities and activities” within the UK.

Abedi also had a Guantánamo connection and is understood to have known former detainee Ronald Fiddler, 50, alias Jamal al-Harith, who lived nearby in south Manchester. In February this year he detonated a suicide truck in Mosul, Iraq

The Deghayes brothers frequently went to Libya. British police found a Facebook account registered in Libya, linked to Jaffar Deghayes and which contained an image of men in balaclavas on horseback in a desert in front of jihad’s “black flag”. Four months after the discovery, Jaffar headed to Syria.

Abedi, who some sources say also travelled to Syria, returned from Libya days before the attack. On Wednesday Abedi’s father and brother Hashem were arrested in Tripoli by counterterrorism forces. A third brother, Ismail, has been arrested in the UK, raising, superfically at least, the latest instance of radicalised siblings.

Two of the Deghayes brothers who went to Syria had a history of delinquency, smoking cannabis and repeated low-level crime. Abedi, too, smoked cannabis, drank and, according to at least one source, was known to the authorities for antisocial behaviour. Both Abedi and Jaffar Deghayes – the youngest British jihadist thought to have died in Syria – came to the attention of Prevent, the government’s anti-radicalisation programme, but no action was taken. Even though both Abedi and the Deghayes brothers were on the radar of counter-terrorism officials, they were able to travel abroad.

It is a cliche of the globalised era to say that conflicts in faraway countries can affect our own lives. In the jihadi era, we are only now coming to realise the toxic British legacy of the dysfunctional, violent world of Gaddafi’s Libya.