(CNN) -- The town of Derna is not much to look at -- a heap of Soviet-style concrete buildings in a deprived and windswept corner of eastern Libya.
But it has a rich history -- fought over and colonized since Roman times -- and a stunning location on the Mediterranean. It has also gained a reputation as a hotbed of jihadists. And that has diplomats and analysts asking whether the unrest in Libya might provide an opening for al Qaeda and fellow travelers, just a short hop from Europe.
Derna even made it into U.S. diplomatic cables obtained by Wikileaks. A cable from 2008 describes it as a "wellspring of Libyan foreign fighters" for al Qaeda in Iraq. High youth unemployment, discrimination by the Gadhafi regime and the influence of veteran Libyan jihadists from Afghanistan all played a role in radicalizing a new generation.
"Other factors include a dearth of social outlets for young people, [and] local pride in Derna's history as a locus of fierce opposition to occupation," the cable said. "Most young men watched a mix of al-Jazeera news, religious sermons and western action films on English language satellite channels broadcast from the Gulf. The result was a heady mixture of violence, religious conservatism and hatred of U.S. policy in Iraq and Palestine."
Today, Derna is very much in the opposition's hands, and accounts from eastern Libya say Islamists and others are fighting side-by-side with one aim: removing Moammar Gadhafi. But what comes next?
Gadhafi has been quick to raise the specter of al Qaeda as the beneficiary of unrest in Libya, even claiming that it was drugging young Libyans into opposing his rule. The regime has also paraded a former member of the Libyan Islamist Fighting Group who had allegedly been "captured" during fighting in Zawiyah.
While the regime's claims may seem outlandish, a former leader of Libyan jihadists tells CNN that al Qaeda will seek to take advantage of chaos in Libya.
"If there is a power vacuum in Libya there will be an open market for al Qaeda," says Noman Benotman, a former commander in the Libyan Islamic Fighting Group and one-time ally of Osama bin Laden. The LIFG fought the Gadhafi regime in the 1990s, but formally ended its campaign to overthrow the Libyan regime two years ago, and repudiated al Qaeda. Benotman is now a senior researcher at the Quilliam Foundation in London, a counter-terrorism think tank.
Having played no role in the rebellion so far, al Qaeda and its affiliates will have to play catch-up if they do want to exploit the situation, says Benotman. Individuals who might have jihadist sympathies are keeping them under wraps for the sake of uniting with one aim: removing Gadhafi, he says. Added to which there has been a broad welcome among Libyan rebels of all stripes for U.S. and coalition airstrikes to protect the city of Benghazi.
According to Benotman, dozens of former LIFG fighters have now joined rebel efforts to topple Gadhafi, but he stressed that they had done so in a personal capacity rather than organizing operations as a group.
Protest movements across the Middle East -- predominantly secular and pro-democracy -- have so far reduced the jihadist message to irrelevance. But Benotman sees potentially dangerous parallels in Libya with neighboring Algeria and with Afghanistan.
After the Soviet withdrawal in 1989, the West walked away from Afghanistan rather than use its "soft power" to bring about positive change, he says. The Taliban eventually filled the void. As a young jihadist, Benotman was there to witness it.
And in Algeria, a 1992 army coup following electoral gains by radical Islamist parties spawned a violent insurgency. More than 100,000 Algerians were killed in a savage conflict between the state and Islamist extremists before the insurgency waned in the mid-1990s.
Some Western counter-terrorism officials fret that a prolonged civil war in Libya could open up space for al Qaeda. Governments and NGOs have to be quick, says Benotman, in helping rebel-held areas develop education, health-care and the institutions of democracy.
Libya -- like Yemen -- has a less developed "civil society" than either Egypt or Tunisia after 40 years of authoritarian rule. It also has entrenched tribal rivalries and a small middle class. Such conditions were compounded by Gadhafi's strategy of divide and rule through a baffling array of competing power centers.
Al Qaeda has already scented an opportunity. Its leading ideologue, Abu Yahya al-Libi -- himself a Libyan -- told Islamists in the country: "Store your weapons and do not relinquish them." In an audio tape released on March 12, he said that "ousting these regimes is not the end in making a change."
A week later the leader of al Qaeda in the Islamic Maghreb (AQIM) had a similar message.
In an audiotape posted on Jihadist websites and translated by the SITE Intelligence Group, Abu Musab Wadud told Gadhafi's opponents: "We will be side-by-side with you, Allah willing."
Until now, That may be wishful thinking. AQIM has in recent times been restricted to remote parts of Mali, Niger and Mauritania and has suffered leadership splits. Wadud may also have damaged his cause by predicting the United States and NATO would never help the rebels because they were the "source of the disaster." But al Qaeda is nothing if not persistent.
And there is a long history of Islamist radicalization in Libya, especially in the impoverished, restive eastern provinces.
At the peak of the Iraqi insurgency, more jihadists per capita traveled to join al Qaeda in Iraq from Libya than from any other country. And according to al Qaeda records seized by the U.S. Army in Iraq, in 2006-07 more volunteers -- a total of 53 -- travelled to Iraq from Derna than any other city in the Arab world. And in the 1990s, Benotman's group had tried to establish a safe haven in Derna, eventually being bombed into submission by the Libyan air force.
Which brings us back to the U.S. cable from 2008, in which an American diplomat who traveled to Derna, quoted a local businessman who had "likened young men in Derna to Bruce Willis' character in the action picture 'Die Hard,' who stubbornly refused to die quietly. For them, resistance against coalition forces in Iraq is an important act of 'jihad' and a last act of defiance against the Gadhafi regime."
"It's jihad -- it's our duty, and you're talking about people who don't have much else to be proud of," he said. Maybe that at last is changing.