The first time the members of al-Qaida emerged from the forest, they politely said hello. Then the men carrying automatic weapons asked the frightened villagers if they could please take water from the well.
Before leaving, they rolled down the windows of their pickup truck and called over the children to give them chocolate.
That was 18 months ago, and since then, the bearded men in tunics like those worn by Osama bin Laden have returned for water every week. Each time they go to lengths to exchange greetings, ask for permission and act neighborly, according to locals, in the first intimate look at how al-Qaida tries to win over a village.
Besides candy, the men hand out cash. If a child is born, they bring baby clothes. If someone is ill, they prescribe medicine. When a boy was hospitalized, they dropped off plates of food and picked up the tab.
With almost no resistance, al-Qaida has implanted itself in Africa's soft tissue, choosing as its host one of the poorest nations on earth. The terrorist group has create a refuge in this remote land through a strategy of winning hearts and minds, described in rare detail by seven locals in regular contact with the cell. The villagers agreed to speak for the first time to an Associated Press team in the "red zone," deemed by most embassies to be too dangerous for foreigners to visit.
While al-Qaida's central command is in disarray and its leaders on the run following bin Laden's death six months ago, security experts say, the group's 5-year-old branch in Africa is flourishing. From bases like the one in the forest just north of here, al-Qaida in the Islamic Maghreb, or AQIM, is infiltrating local communities, recruiting fighters, running training camps and planning suicide attacks, according to diplomats and government officials.
Even as the mother franchise struggles financially, its African offshoot has raised an estimated $130 million in under a decade by kidnapping at least 50 Westerners in neighboring countries and holding them in camps in Mali for ransom. It has tripled in size from 100 combatants in 2006 to at least 300 today, say security experts. And its growing footprint, once limited to Algeria, now stretches from one end of the Sahara desert to the other, from Mauritania in the west to Mali in the east.
The group's stated aim is to become a player in global jihad, and suspected collaborators have been arrested throughout Europe, including in the Netherlands, Spain, Italy, England and France. In September, the general responsible for U.S. military operations in Africa, Army Gen. Carter Ham, said AQIM now also poses a "significant threat" to the United States.
The answer to why the group has thrived can be found in this speck of a town, where homes are made of mud mixed with straw and families eke out a living either in the fields of rice to the south or in the immense forest of short, stout trees to its north.
It's here, under a canopy stretching over an area three times larger than the city of New York, that Sokolo's herders take their cattle. They avoid overgrazing by organizing themselves into eight units linked to each of the eight wells, labeled N1 through N8, along the 50-mile-long perimeter of the Wagadou forest. They pay $5 per year per head of cattle, and $3 per head of sheep, for the right to water their animals.
When the al-Qaida fighters showed up about 1 1/2 years ago with four to five jerrycans and asked for water, they signaled that they did not intend to plunder resources. They stood out in their tunics stopping a little below the knees, small turbans and beards, a foreign style of dress associated with the Gulf states and bin Laden.
"From the moment you lay eyes on them, you know that they're not Malian," said 45-year-old herder Amadou Maiga.
They started to come every four or five days in Land Cruisers, with Kalashnikovs slung over their shoulders. At first they stayed for no more than 15 to 20 minutes, said the villagers, including herders, a hunter and employees of the Malian Ministry of Husbandry who travel to the area to vaccinate animals and repair broken pumps. If on Monday they took water from one well, on Wednesday they would go to another, always varying their path.
Fousseyni Diakite, 51, a pump technician who travels twice a month to the forest to check the generators used to run the wells, first ran into the cell in May 2010, when he saw four men in Arab dress inside a Toyota Hilux truck, all with AK-47s at their feet.
He said the men come with medical supplies and try to find out if anyone is sick.
"There is one who is tall with a big chest _ he's Arab, possibly Algerian. He's known for having an ambulatory pharmacy. He goes from place to place giving treatment for free," Diakite said.
They venture into the camps where the herders sleep at dusk and hand out cash to villagers who join them for prayers, he said _ bills of 10,000 West African francs (about $20), equal to nearly half the average monthly salary in Mali.
Most of the herders sleep in lean-to's in camps at the forest's edge. Because these are temporary settlements, they do not have mosques, unlike most villages in this nation twice the size of France that is 90 percent Muslim.
In Boulker, a hamlet near the forest, the fighters left 100,000 francs (around $200), instructing locals to buy supplies and build an adobe mosque, Diakite said.
"They said that for every population center with at least 10 people, there should be a mosque," he said.
Along with its poverty, Mali has an enormous geography and a weak central government _ not unlike Afghanistan, where bin Laden first used the charm offensive to secure the loyalty of the local people, said Noman Benotman, a former jihadist with links to al-Qaida, now an analyst at the London-based Quilliam Foundation.
"We used to teach our people about this. It's part of the military plan _ how to treat locals. This is the environment that keeps them alive," said Benotman, who first met bin Laden in Sudan and who spent years fighting alongside al-Qaida in Afghanistan. He said bin Laden gave his fighters specific instructions on how to conduct themselves: Don't argue about the price, just make the locals happy. Become "like oxygen" to them.
AQIM is taking the lesson to heart. Soon after they began taking water, one of the bearded fighters approached a shepherd at the pump to buy a ram. The fighters were looking to slaughter it to feed themselves. The shepherd offered it to him for free _ too afraid to ask for money, said Maiga, the man's friend.
But the stranger refused to take the ram without payment, and immediately handed over a generous sum.
"They seem to know all the prices ahead of time. They point to a ram and say, `I'll buy that one for 30,000 cfa ($60),'" said Maiga, quoting the highest sum a herder could expect to get for a ram in these parts. "They never bargain."
AQIM grew out of the groups fighting the Algerian government in the 1990s, after the military canceled elections to stave off victory for an Islamist party. Over the next decade, they left a trail of destruction in Algeria. Around 2003, they sent an emissary to Iraq to meet an al-Qaida intermediary, according to Benotman. Three years later, the insurgents joined the terror family, in what second-in-command Ayman al-Zawahiri called "a blessed union."
Since then, their attacks have taken on the hallmarks of al-Qaida. A pair of explosions this August killed 18 people as they tore through the mess hall of Algeria's military academy, with the second bomb timed to hit emergency responders.
Al-Qaida in turn appears to be learning from its affiliates, which have used kidnappings for ransom in Algeria, Yemen, Pakistan, Iraq and Afghanistan. After bin Laden's death in May, investigators found files on his hard drive showing plans to turn to kidnapping to compensate for a decline in donations.
AQIM in particular has perfected what analysts call a "kidnap economy," drawing on its refuge in Mali, according to diplomats, hostage negotiators and government officials. In 2003, the group kidnapped and transported 32 mostly German tourists from southern Algeria to Mali, where, according to a member of Mali's parliament, they struck a deal with local authorities that is still in effect today.
"The agreement was, `You don't hurt us, we won't hurt you,'" said the parliament member, formerly involved in hostage negotiations, who asked not to be identified because of the danger involved.
The government of Mali denies these accusations, but officials cited in diplomatic cables published by WikiLeaks make the same assertion. The president of neighboring Mauritania, Mohamed Ould Abdel Aziz, told his American counterparts in 2009 that Mali is "at peace with AQIM to avoid attacks on its territory." Whereas the al-Qaida cell has captured more than 50 foreigners in Algeria, Niger and Mauritania, hardly any of the violence has touched Mali.
The cell has also managed to recruit local fighters, including 60 to 80 Tuaregs, the olive-skinned nomads who live in the Sahara desert, according to a security expert. And villagers say they have seen black-skinned sub-Saharan Africans in the pickups speaking the languages of Mali, Guinea and Nigeria.
"The situation in Mali is they have become locals _ they are not foreigners," said Benotman. "This is really, really very, very difficult to do, and it makes it very hard to get rid of them."
One thing still stands in al-Qaida's way: Its hardcore ideology does not gel with the moderate Islam practiced by Mali's nomads. Most of them said they were afraid, caught between need for the money al-Qaida offers and wariness of its extremist beliefs.
When bin Laden died, the members of the local cell went from well to well to ask people to pray for his soul, according to Amaye ag Ali Cisse, an employee of the Ministry of Husbandry who travels twice a month to the wells to oversee the vaccination of animals.
"Everyone is uncomfortable," he said. "This is a religion that doesn't belong to us."
The herders say the fighters have not tried to impose their ideology by force. Instead, they say that the AQIM members wait until they have seen a herder at least a few times before broaching the subject.
"It was the third time that I saw them that they started preaching to me," said Maiga. "They said that everything they do is in order to seek out God."
Herder Baba Ould Momo, 29, said he tries to come up with an excuse to leave when the pickup trucks arrive at the well, because he's afraid the terror cell will pull him in. He said they backed off when they noticed he wasn't interested.
"The first thing they try to do is invite people to join them in the forest. If they see that the person is wavering, it's then that they start preaching _ saying everything is transitory," said Momo, who like most of the herders wears plastic flip-flops, with a robe of wrinkled cloth. "But if the person is categorical in saying `No,' they leave them alone."
In June, Mauritania and Mali led a rare joint attack on the al-Qaida cell in the Wagadou Forest. However, herders say that a week earlier, the al-Qaida fighters told them that an attack was imminent and that they had laid down land mines in the forest. Mauritania blames Malian officials for tipping off AQIM.
The herders said that for around two weeks, they didn't see the bearded fighters. Then they returned with a new fleet of Hilux pickup trucks, and with more men. Since then, the fighters' tracks have been all over the forest floor, in a map of constant movement, said 60-year-old hunter Cheickana Cisse. They no longer sleep in the same place.
Just as Cisse was taking a drink of water at the N7 pump on a recent evening, two pickup trucks mounted with anti-aircraft cannons and loaded with combatants drove up. The men had chains of ammunition strapped across their chests, and belts loaded with cartridges.
They laid their AK-47s in a circle on the ground to create a space to pray, like a symbolic mosque. One of them asked Cisse if he had heard of bin Laden.
"He said, `We're like this with bin Laden,'" Cisse explained, intertwining his right and left index fingers like a link in a chain. "He said, `We're al-Qaida.'"
The elderly hunter tried to slip away just as one of the fighters made the call to prayer.
"And they said, `You? Aren't you going to pray?' They told me to come into the circle. I could feel them watching me," he said.
The men kneeled inside the circle of weapons. Four others guarded them, including one who climbed on the roof of the truck. Cisse tiptoed inside and began going through the prayer. "I kept stealing glances to see if they were doing the same moves as me," he said. "I know the words, but I was scared."
When the group had finished, the four who had kept vigil took their turn inside the circle. Cisse quietly walked away.
They didn't try to stop him.