U.S. COUNTERTERRORISM AGENCIES have long been preoccupied with the threat posed by the recruiting successes of the Somali terrorist group al Shabaab in Western countries. The group has managed to lure hundreds of foreign fighters — including some 40 Americans — to Somalia through online propaganda videos and word-of-mouth in disaffected immigrant communities. In recent years, however, al Shabaab has turned on the foreign fighters in its own ranks, waging a brutal campaign to purge the perceived spies from its midst. An intimate account of the Shabaab civil war was provided to The Intercept in a series of interviews conducted with a current member of al Shabaab and a source who has maintained close contacts with the group. Al Shabaab has assassinated several foreign fighters on the CIA’s kill/capture list over the past few years and currently runs a network of secret prisons that hold, on charges of spying, U.S., British and other Western citizens who came to Somalia to join Shabaab, The Intercept has found. Shabaab operatives torture detainees using techniques such as waterboarding, beatings, and food and sleep deprivation, and conduct public executions of suspected spies, including by crucifixion. Ibrahim* is a citizen of a Western country who traveled to Somalia several years ago to join Shabaab. He is currently living in a Shabaab-controlled territory, and the group believes he is a loyal member. The Intercept, which has confirmed his real identity, granted him anonymity and agreed not to identify his country of origin because criticizing Shabaab can result in imprisonment or death. “I’d be arrested and tortured,” Ibrahim said when asked what would happen if he spoke out against the group. Like other young Westerners of Somali origin, Ibrahim decided to move to Somalia after watching Shabaab’s videos on the Internet and following the news of battles between Somali militants and the U.S.-backed African peacekeeping force, AMISOM. “At that time there was a lot of stuff going on and I felt like it was my religious duty to participate in the holy jihad that was going on in Somalia. And I felt that it was my responsibility as a Muslim youth to support my brothers and sisters in Somalia against the enemy,” he says. “I felt like the call of Somalia had to be answered.” Ibrahim says he believed that Shabaab was fighting to establish a Shariah law system that would allow him to live according to his deeply held religious convictions. Joining the jihad, he believed, would help to make that a reality in Somalia. “It was at the beginning. At that time they were happy to see what you call foreign fighters — they welcomed them big time,” he says. “We took part in training, small training, basic training, small weapons and such. Everything was easy.” He adds: “According to the media, somehow they over-exaggerate about Shabaab training. The training is basically just simple, small arms and physical training and discipline.” That period of relative harmony within the group would not last. And now Ibrahim wants to tell his story so that others will know not to follow in his path. For Keith Ellison, a Minnesota congressman who represents the largest Somali community in the United States, in the Minneapolis/St. Paul area, Ibrahim’s cautionary tale is an example of the kind of story alienated members of Shabaab should be encouraged to tell, rather than simply locking them up or killing them, which is the current U.S. government approach. “I think somebody who has been inside Shabaab telling the truth about how Shabaab is really a criminal terrorist group and not about the liberation of Somalia is probably more likely to promote safety and security than just throwing that same kid in jail,” Ellison says. “We need to learn from these people and we need to use them to message to young people who might be lured by a message from al Shabaab.”

SOON AFTER JOINING al Shabaab, Ibrahim met the most famous American fighter in Somali history — a young U.S. citizen from Alabama, Omar Hammami, known in Somalia as Abu Mansour al Amriki. “He was a happy, young guy — typical Western,” Ibrahim recalls. Ibrahim viewed Hammami as a mentor and a leader within the contingent of foreign fighters. Hammami had traveled to Somalia in 2006 and joined fighters from the Islamic Courts Union as they battled a U.S.-backed Ethiopian invasion of the country. The ICU, a populist coalition that expelled CIA-backed warlords from Mogadishu in the summer of 2006, sought to create a government based on Shariah law. But the ICU’s time in power would be short lived. U.S. and Ethiopian troops began assassinating and imprisoning its leaders, and Ethiopian troops occupied Mogadishu and other areas of Somalia for two years. As the Islamic Courts disintegrated, al Shabaab emerged as the only remaining resistance force against foreign occupation. Overnight, the group went from being a small part of the Islamic movement to “liberate” Somalia to the vanguard of that struggle. It solidified its affiliation with al Qaeda and began aggressively recruiting foreign fighters. Al Qaeda, meanwhile, saw potential in Somalia as a future base of operations. In early January 2007, bin Laden’s deputy, Ayman al Zawahiri, addressed the situation in Somalia in a recording released online. “I speak to you today as the crusader invader forces of Ethiopia violate the soil of the beloved Muslim Somalia,” he began. “I call upon the Muslim nation in Somalia to remain in the new battlefield that is one of the crusader battlefields that are being launched by America and its allies and the United Nations against Islam and Muslims.” He implored the mujahedeen, “Launch ambushes, land mines, raids and suicidal combats until you consume them as the lions eat their prey.” Hammami had won street credibility within al Shabaab for being among the first to answer that call. He was there during a period of legendary battles, had a Somali wife and quickly became the prized English-speaking ambassador for Shabaab’s effort to attract Western youth. He would post YouTube videos describing the joys of the jihad and the comfort of an Islamic lifestyle. He even produced hip-hop songs predicting his demise by a drone strike or cruise missile. “He was a kind of symbol for the foreign fighters — he was here since the end of 2006 and he fought in a lot of battles and he was well educated. He was very smart,” says Ibrahim.

In late 2007, a year after he first arrived in Somalia, Hammami appeared on Al Jazeera — with a keffiyeh covering much of his face — explaining why he had joined al Shabaab. “Oh, Muslims of America, take into consideration the situation in Somalia,” he declared. “After 15 years of chaos and oppressive rule by the American-backed warlords, your brothers stood up and established peace and justice in this land.” By that point, Somali officials estimated that more than 450 foreign fighters had come to Somalia to join al Shabaab in its struggle. Following Hammami’s lead, after receiving basic training from Shabaab, Ibrahim began to engage in regular attacks against AMISOM troops — mostly from Uganda and Burundi. “I took part in a lot of battles, mostly within Mogadishu. I don’t think any battles had a name,” he recalls. “When I came, I stayed with foreign fighters known as muhajireen.” He said there were fighters from the United States, Canada, the U.K., Denmark, Sudan, Saudi Arabia and East African countries. Soon, however, powerful Somali leaders of al Shabaab came to see the flood of foreign fighters as a threat to their own fiefdoms. By 2011, a rift had emerged within the group — one that would pit the foreign fighters against the Somali leadership in bloody conflict, and would ultimately lead Ibrahim to regret coming to Somalia to join Shabaab.

Members of Somalia’s al Qaeda-backed Islamic militia al Shabaab in Mogadishu, Somalia, Nov. 16, 2010. (Badri Media/EPA/Landov)

AS THE SOMALI LEADERS of al Shabaab have moved to reassert their authority, al Qaeda, along with the foreign fighters, has found itself marginalized. Osama bin Laden had always wanted to establish a foothold in Somalia for al Qaeda. But the country’s clan-based system made that very difficult. The Ethiopian invasion and U.S. killing campaign had changed that. Bin Laden named Mohammed Fazul, a Comoros-born al Qaeda operative, as a head of al Qaeda in East Africa with a major directive to support the jihad in Somalia. Fazul was one of the masterminds of the 1998 U.S. Embassy bombings in Kenya and Tanzania and had organized a series of attacks against Western targets in Kenya in 2002. Abdirahman “Aynte” Ali, a leading scholar on al Shabaab, told me that Fazul served as “the bridge between al Shabaab and al Qaeda, tapping into the resources of al Qaeda, bringing in more foreign fighters, as well as financial resources — more importantly, military know-how: how to make explosives, how to train people, and so on. So that’s when they have gained the biggest influence that they needed.” In August 2010, al Shabaab declared what it called a “massive war” against AMISOM troops, which at the time numbered some 6,000. They hit convoys, deployed suicide bombers and attacked government ministers, sowing fear and terror and seizing some territory in Mogadishu. The U.S. and other Western nations began beefing up support of the besieged peacekeeping force, which led to an overwhelming offensive — complete with indiscriminate shelling of Shabaab positions — and ultimately forced Shabaab into what the group tried to characterize as a strategic retreat. Shabaab had taken heavy losses, and its leaders began to bicker over the group’s next steps. By 2011, Fazul Abdullah Mohammed’s world had grown very small. Almost all of his East African al Qaeda comrades had been assassinated by JSOC, and he lived life on the run. He had a $5 million bounty on his head, courtesy of the U.S. government. Some intelligence reports indicated that he may have had plastic surgery, and there were periodic reports of him popping up throughout the Horn of Africa using aliases and fake passports. With many of the veteran al Qaeda leaders gone, Fazul was increasingly isolated and dealing with the complexities of Somalia’s clan politics. Then, on May 2, Osama bin Laden was killed. Fazul was finding it more and more difficult to deliver adequate resources from al Qaeda to al Shabaab, and al Shabaab sought out different means of financing and support, including making deals with powerful clans. So Fazul found himself at odds with al Shabaab’s Somali leadership. I interviewed a Somali intelligence source who was given access to some of Fazul’s writings seized by his agency in 2011. They described growing “fissures,” revealing that “Fazul thought, essentially, that al Shabaab is going the wrong way, that the traditional warfare that’s going on between al Shabaab and the government was not sustainable anymore.” Fazul alleged that al Shabaab was recruiting young people, but then “in a few months they’re just sending them as suicide bombers. And he thought that was such a bad idea, and that in the long run it would just erode fighters out of al Shabaab.” The source added: “I mean this guy’s looking way ahead, and he’s accusing the al Shabaab leadership of being shortsighted.” On June 7, 2011, Somali intelligence operatives informed the CIA that Fazul had been killed by some local militiamen in Somalia. Fazul, they said, had taken a wrong turn, had an altercation with the soldiers at a checkpoint and was gunned down. The Americans, the Somali intelligence official told me, were “unbelievably grateful.” Then-Secretary of State Hillary Clinton called Fazul’s death “a significant blow to Al Qaeda, its extremist allies and its operations in East Africa. It is a just end for a terrorist who brought so much death and pain to so many innocents.” Neither Ibrahim nor the source with close ties to al Shabaab interviewed for this story believe the official version of events in Fazul’s death. They suspect that Fazul was assassinated, not by militiamen or by the CIA, but rather by al Shabaab. “At that time, the former leader of al Shabaab, Abu Zubayr, and Fazul, they kind of had some kind of clash,” says Ibrahim. “I’ll be killed by Shabaab soon. If I am killed, don’t waste my blood,” Ibrahim says Fazul told a senior Somali Shabaab leader who supported the foreign fighters. “The conflict continued until this assassination happened. I think al Shabaab planned that assassination. I don’t think it was a mistake. I think it was set up,” says Ibrahim.

Fazul Abdullah Mohammed, left, and an unidentified man lying dead in Mogadishu, Somalia, June 8, 2011. (Farah Abdi Warsameh/AP)

IN THE MONTHS after Fazul’s death, the fissure between the local Shabaab leadership and the foreign fighters widened. Omar Hammami began openly criticizing the Shabaab leadership’s tactics and decisions. “He never accepted any kind of humiliation and disrespect, and basically he stood up for his rights,” says Ibrahim. The source with close ties to al Shabaab told me that during Hammami’s conflict with Shabaab’s leadership, Hammami would, at times, walk around with a suicide vest on. The message: if you try to kill me, you will go down with me. Hammami and other leading foreign fighters forged an alliance with Mukhtar Robow, a longtime senior member of Shabaab. That’s when the internal civil war for control of Shabaab exploded. Shabaab began an assassination campaign against prominent foreign fighters and their Somali allies, several of whom were wanted by the U.S. or designated for kill or capture by the CIA. In June 2013, they killed Sheikh Moalim Burhan and Ibrahim Afghani, a Somali who had lived in the U.S. in the 1980s. “Those guys somehow they wanted to start some kind of small revolution, and some kind of uprising. They tried to speak publicly,” says Ibrahim. “They took them out in Barawe, killed them both.” Robow, who also had a $5 million bounty issued by the U.S., and another Shabaab leader publicly denounced Shabaab’s chief, Abu Zubayr. Robow accused the Shabaab leader of ordering the killings of top foreign fighters and of plotting to kill Hammami, calling it “a big crime against the blood of our brothers.” That month, Robow fled Shabaab-controlled territory and returned to the safety of his family’s stronghold. “He felt like he wasn’t safe, so he ran away to Bakool, where his family stayed and he’s under protection by his clan now,” says Ibrahim. When Robow left, Hammami lost his most powerful protector. He began live-tweeting Shabaab’s attempts to kill him, at one point posting a picture of what he claimed was a wound from a would-be assassin’s bullet that had grazed his neck. “Just been shot in neck by shabab assassin. not critical yet,” Hammami tweeted in April 2013. Later he alleged that Shabaab was sending in assassins from various directions: “abu zubayr has gone mad. he’s starting a civil war,” he tweeted. Eventually, on September 12, 2013, Hammami was killed. Long sought by the U.S. government, his killers were not from the CIA or JSOC, but al Shabaab. “The foreign fighters made [Shabaab] go forward. And one of them was Abu Mansour al Amriki [Hammami]. He played a big role, he was a very smart guy, he improved a lot of things,” recalls Ibrahim. “He made Shabaab be more international. The Shabaab killed him, man. That’s clear cut because the guy became a public threat.” Hammami was killed alongside his friend and fellow foreign fighter — a British citizen who went by the name Osama Pakistani. As Ibrahim watched Shabaab implode and witnessed his fellow foreign fighters imprisoned or assassinated, suspicions that had lingered in the back of his mind began to dominate his thoughts. He realized he had made a life-altering and potentially life-ending mistake in coming to Somalia. The story could end, not with his dying in jihad, but in being killed or imprisoned by his former allies from al Shabaab. Some of Ibrahim’s colleagues have been killed, while others have disappeared in secret prisons run by Shabaab. Their imprisonment is often preceded by an allegation of spying or conspiring against the Shabaab leadership. “They had secret prisons before, but the secret prisons became more effective after the killings of Abu Mansour al Amriki and Sheikh Burhan and all those guys,” he says. “Whoever goes against Shabaab, says anything they don’t like, they will be seen as an enemy to the Shabaab and somehow they will hit you [because] you are not serving their interest. You’ll see yourself missing, in an underground prison being tortured.” What kind of torture? “Beatings, waterboarding, they used some kind of gas. They tie you up for hours and hours. Lack of food, lack of sleep. You might be whipped outside, nighttime. You might be crucified, tied to a car. Tied to the back of an SUV [that they] then drive. All these types of things.” Most of the people in the prisons, Ibrahim says, are foreign fighters, including, at present, at least two Americans. “Most of the time what they do is they will categorize you as a spy and will have you locked up in an underground prison,” he says. “You know you might be serving over a year and when you come out then you might have two options: to keep quiet or otherwise you’ll be deported.” Deported, he says, means being sent to a country that would likely charge you as a terrorist for being a member of al Shabaab, as the U.S. has done repeatedly. It could also mean being dumped on the streets of Mogadishu. The Somali government has started an amnesty program for Somalis who leave al Shabaab. If they turn themselves in, they will have their freedom. But it comes with the risk of assassination by Shabaab.