The investigation by the Centro Nacional de Inteligencia and the Renseignements Generaux was launched after Spanish police found that the Islamists behind the March 2004 bombings in Madrid bought their explosives from former miners in return for blocks of hashish. The bombings claimed 191 lives.

Spain's role as a transit point for drugs was highlighted last week when Madrid hosted the US Drug Enforcement Agency's annual conference. Experts heard not only that North African hashish was funding terrorism in Europe, but also that West Africa had become a new hub for South American cocaine shipments bound for Europe.

Morocco is the world's leading cannabis exporter, with an annual crop estimated to be worth at least £2bn. Last month, the Moroccan navy seized three tonnes of Europe-bound hashish off the Mediterranean port of Nador. The same week, Spanish coastguards seized 4.3 tonnes of Moroccan resin off Ibiza.

The joint secret service investigation finds that hashish is part of a 'complex financing network' serving the Algeria-based Salafist Group for Preaching and Combat, affiliated since last year to al-Qaeda. The group claimed responsibility for two bombings in Algiers on 11 April that killed 30 people and left 200 injured.

French terrorism expert Dominique Thomas said the link between drug dealing and Islamic terrorism was not new: 'The issue stands at the core of divisions within al-Qaeda between those who believe that the end justifies the means and others who argue that drugs are incompatible with Islam.'