Islamist groups are using their hold over key urban areas of Mali to recruit, arm and train growing numbers of fighters and could pose a threat to Europe within two years, government and security sources believe.

The al-Qaida-linked rebels have taken exclusive control of the north, having pushed out secular Tuareg separatists. "If Islamists continue to control vast areas of Mali where they can do what they like, then this will pose a direct threat to Europe," a senior western diplomat in the capital, Bamako, said.

"You cannot forget how close this region is to Europe. They are currently recruiting people in northern Mali, offering them money, training and weapons. If this continues, it is a matter of time before it affects Europe directly."

Northern Mali has been under insurgent control since the government was toppled in a military coup in March. Tuareg rebels – who are demanding an independent state of "Azawad" in the Sahara – initially joined forces with groups backed by al-Qaida in the Islamic Maghreb (AQIM), including Ansar Dine, Mujao and the Nigerian terrorist organisation Boko Haram.

Mali locator Photograph: Graphic

But the alliance broke down recently with fighting breaking out between different factions. On Thursday, Islamists consolidated their control, driving Tuareg rebels from their last stronghold in the town of Ansogo, leaving the entire north of Mali, including Gao – the main base of the Malian army – in Islamist hands.

Islamists have surrounded Gao with landmines, making it almost impossible to enter. But the Guardian has obtained film footage depicting foreign Islamists patrolling Gao, dragging the bodies of senior Tuareg insurgents through the town behind pick-up trucks and conducting public whippings of three young people for "offences" under sharia law, including smoking and having sex outside marriage.

"Islamists supported by AQIM are now really getting complete control of the region, and huge access to weapons and arms coming from Libya," said Valentina Soria, a counter-terrorism and security analyst at the Royal United Services Institute thinktank. "This can well develop into a more direct security threat for Europe – either by enabling AQIM to either plan and carry out attacks directly in Europe or the US, or to provide a safe haven for people connected to terrorist organisations to get some training and access to weapons."

She added: "The Sahel is closer to Europe than Afghanistan or Pakistan and easier for people from Europe to get in and out, so it provides all sorts of advantages from a logistics point of view for people who want to link up with AQIM and like-minded groups."

Further details have emerged of the myriad Islamist groups operating in Mali. "Mujao" – a west African offshoot of AQIM – is increasingly controlling territory, having ousted the Tuareg rebel group MNLA and eclipsed another Islamist group, Ansar Dine. "Ansar Dine does not really exist," said one Malian analystwho comes from Gao and is one of the few based outside the city to move in and out since its capture. "The leaders of Ansar Dine are a front for al-Qaida, who took advantage of the MNLA rebellion."

The footage seen by the Guardian also shows Malians co-operating with Mujao. "Yes there are Afghans, yes there are Algerians, but 70% of the Islamists are Malians," said the analyst. "And there are people who left Bamako who went to Gao to join the Islamists. This is a much more complicated situation than we in Mali like to admit."

While some Malians are joining the Islamic insurgency, others are arming themselves to return the country to secular, civilian rule. In Bamako, several hundred young people have joined the military wing of Action des Jeunes pour Sauver le Nord (AJSN), a voluntary army that claims it has weapons and will imminently deploy to the north.

"We are ready to die to save our country. We are warriors – it's in our history – and it is simply a question of patriotism that we are prepared to sacrifice ourselves personally to reclaim the north," said Mohamadou Diouara, 26, founder of AJSN. Diouara – a native of Gao and former youth leader – claims to have 1,500 members being trained by soldiers who volunteer to help the recruits, as well as access to weapons and the backing of the Malian army, whom his members have pledged to support.

Many Malians are being increasingly radicalised against the insurgents by the destruction of ancient monuments in Timbuktu, where Islamists have attacked mausoleums and the city's 14th-century Djingareyber mosque, and by the growing humanitarian crisis in the region.

Northern Mali was already facing a food crisis before the coup and capture of towns by rebel fighters. Now aid agencies warn the situation is deteriorating further, with critical shortages of essential goods and services and numerous human rights violations.

The willingness of young Malians to fight also represents a growing hostility towards the deployment of foreign troops on Malian soil. "Mali needs to have logistical support and equipment from outside, but not outsiders coming into the country to fight," said Diouara. "We are thinking of the impact an outside intervention would have on the future of the country … A young generation will have an inferiority complex that even when they were ready to put their lives on the line, foreigners had to come in and defend us."

Regional bloc Ecowas says the deployment of an intervention force of between 3,000 and 5,000 west African troops in Mali is imminent. But a senior government source in Mali stated that the government was also against the presence of foreign troops on Malian soil. "Our position remains that rather than sending in troops, we need equipment and logistical support for the Malian army," said the source in the ministry of internal security and civil protection. "If we had that, our army could face the situation in the north. We are continuing to negotiate with Ecowas to this end."

Questions remain as to how an international mission would be funded, while the authorities admit that even in the case of a successful military deployment, they will not be able to completely drive AQIM out of the largely non-policed, borderless and sparsely populated Sahara, where they control a lucrative trade in drugs, people and weapons trafficking to Europe. "AQIM has been in that area since 2002, they will continue to operate in the area," said Abdel-Fatau Musah, Ecow as director for external relations. "Realistically the most important thing we can do is to make sure that they don't continue to control territory – driving them out altogether is not feasible."

The increasing complexity of the security crisis in Mali comes as the country operates without an effective government, creating a power vacuum. The president, Dioncounda Traoré, has been in Paris seeking medical treatment since being attacked by a group of youths who broke into the presidential palace in May. Other key government figures, including the prime minister, Cheikh Modibo Diarra, and the foreign minister, Soumeylou Boubèye Maïga, are abroad seeking consensus about how to take the country back to civilian rule by an Ecowas deadline of 31 July.

Experts are critical of the pressure exerted on Mali's government by the international community, stating that regional bodies have failed to provide guidance or military assistance. "What is frustrating is that apart from official statements denouncing what is happening on the ground from the EU and the US and other governments, nothing is actually being done," said Soria.

Last week, the British prime minister, David Cameron, held a rare 30-minute private audience with the president of Niger, Mahamadou Issoufou, during which they discussed the security crisis and food shortages across the Sahel.

But despite public acknowledgements of the severity of the problem, a $190m (£122m) initiative by the European commission to improve security in the Sahel, and millions spent by the US on its Africa Command (Africom) military support operation, diplomats say driving militants out of the Sahara is still seen as "a Malian problem".

"There is huge reluctance to get involved," said the diplomat. "Western powers are simply not queuing up to put money in – there is far too much concern about the cost of Libya and events in Syria, which are more pressing."

"It is a problem of resources, but to me this represents a lack of strategic insight," said Soria. "It's always the case that governments tend to address the problem for security issues when they become imminent or direct, and that is the main issue."

Concern is also mounting for the economic situation in Mali, which is landlocked and ranks among one of the poorest countries in the world. It has lost hundreds of millions of dollars in bilateral aid since the March coup, as well as witnessing the mass withdrawal of tourism and private sector investment.

Mali's banks are estimated to have lost $17bn (£11bn) from the looting and destruction of branches in the north, while branches in the south say they are facing the loss of income on a major scale. "The economic situation since the coup has been very difficult," said the managing director of one bank, who did not want to be named. "Our international clients have closed their accounts and left the country, people who took out loans to start businesses cannot repay them, and our branches in the north have been ransacked and all the cash stolen," he said.

"We were planning to expand, we were hiring and conducting interviews. Now we have had to cancel all our expansion plans, and we will have to start letting existing staff go."

The signs of economic freefall are evident in Bamako, where the city's main avenues are home to boarded up hotels, shops and restaurants. "The restaurants are empty and all the industry connected with them has collapsed," the bank manager said.

One estimate puts the total damage to the Malian economy at 1.5tn CFA francs (about £2bn).