Dakar - National borders are hard to see in the Sahara Desert. Algeria bleeds into Mauritania and Mali and Chad along sand dunes interrupted by occasional oases. Nomads cross easily between countries - as do smugglers and terrorists.
And so the zone between North Africa and the more tropical centre of the continent is becoming an ever-more important battleground in the US war on terror.
Double suicide bombings in April killed 33 people in Algeria and officials in Morocco said they had discovered a suicide bombing conspiracy.
Nations further south have experienced no similar violence, but terrorist training camps have been identified in northern Mali. The West African states just to the south of the Sahara provide what analysts call an ideal environment for terrorist recruitment and activities: poverty, poor security and disillusionment with the government.
"There has been kind of growing attention and concern to the rise of militants and extremist ideologies throughout" the region, said Jennifer Cooke, an Africa expert at the Centre for Strategic and International Studies.
Sahelian countries like Senegal, Mali, Niger and Chad are some of the world's poorest. And a host of countries in the region have weak governments after years of war, and pockets of disenfranchised groups that long felt neglected by their own governments.
The Tuaregs of northern Mali attempted rebellion in the '90s and clashed with government forces as recently as a year ago. During last month's Nigerian elections, gunmen in the Muslim north burned down a police station and killed a dozen officers, leading locals to suggest the possible resurgence of an outlawed militant group called the "Nigerian Taliban" that had used similar tactics.
The US is pushing to strengthen government across the region - aiding militarily and giving civics lessons to disenfranchised groups in an attempt to give potential recruits a sense of belonging to a nation, rather than an ideology.
"We are placing a priority on activities in the north to the extent that we can," the US ambassador to Mali, Terence McCulley, said of the country's arid, sparsely populated region that borders on Algeria. "It's an area that for centuries that has been home to bandits to smugglers, in recent years to terrorist groups."
In Mali's northern Kidal region, this has meant funding a series of community radio stations that attempt to diffuse divisive issues with programmes about how to deal with health problems or land disputes.
"Most of the conflict in the north has to do with water points: two families fighting over a well. So we talk about how to share it, maybe use it at different times of the day," said Dennis Bilodeau, a spokesperson on development programmes in Mali for the US Agency for International Development. The programmes use short skits to illustrate each point.
They're small issues, but important to address in an area that is remote from the central Malian government, hard to reach by road, and a known transit point for groups from Algeria. With similar goals, USAID has funded job training programmes for youth in Niger and is trying to strengthen community groups in Chad, said Elizabeth Martin, a program analyst at the agency's office of conflict management and mitigation.
The US has undertaken a similar hearts and minds strategy in East Africa, which has seen terror attacks - the 1998 bombings of the US embassies in Kenya and Tanzania, the 2002 simultaneous car bombing of a hotel and attempt to shoot down an Israeli airliner over Kenya.
A US counterterrorism base for the Horn of Africa was established in 2002, and its troop are as likely to train African armies in counterterrorism tactics as to provide medical care to villagers.
"If you help to improve the quality of life of people, it creates stability and they may not turn to alternative means - to terrorism," said Jaime Wood, a spokesperson for the US military's European Command, or EUCOM, which oversees West Africa.
Some of the increasing military focus on the continent is reflected on the recent decision by US forces to create an overarching Africa Command.
A EUCOM official said it has confirmed that Nigerians have travelled to terrorist training camps in northern Mali for training.
The official, who spoke on condition of anonymity to protect his ongoing work in the region, did not provide further details on the camps.
West Africa has traditionally embraced a moderate form of Islam. But even Senegal, often seen as one of the more peaceful and more moderate countries in the region, a recent State Department report said the Senegalese government had cooperated in 2006 in helping the US identify terrorist groups operating in Senegal and noted that President Abdoulaye Wade has repeatedly met with an counselled moderation to a Senegalese imam deported from Italy for praising Osama bin Laden.
If the myriad threads didn't already complicate the issue, add the role of politics.
Earlier this month, a Mauritanian court acquitted 24 people who had been accused of acting against the state and collaborating with terrorist groups in connection with a 2005 attack on a Mauritanian army garrison that killed 17 soldiers and wounded 69 others.
Some of those acquitted had been accused of having received military training from Algeria's Salafist Group for Preaching and Combat, better known by its French initials GSPC. Late last year, GSPC joined forces with Osama bin Laden and renamed itself al-Qaeda in the Islamic Maghreb, an Arabic term used to refer to North Africa.
The government in power in Mauritania had been accused of overstating the extremist threat as an excuse to crack down on opponents and to curry favour with the United States. That government was toppled in a military coup, and later replaced with a democratically elected government.
Anneli Botha, a terrorism specialist at South Africa's Institute of Security Studies, said that while much of the focus of counterterrorism on the continent is still on northern and eastern Africa, much of that is because the conflicts in West Africa have so far stayed focused on their own governments. Something that would change if a group like al-Qaeda was able to foment general anti-West or anti-government sentiment.
"When people become disillusioned, they either become involved in terrorism attacks domestically, or internationally - which is the fear," Botha said. - Sapa-AP