Two bombings of churches in Kenya pointed to the resurgence al-Qaeda-linked terrorist groups in East Africa. But a TIME investigation into how the region's countries (and the U.S.) are handling groups like Somalia's al-Shabab leads to accusations of illegal, murky tactics

Thomas Mukoya / Reuters A woman wounded during church attacks in the Kenyan city of Garissa is helped by Red Cross paramedics at Nairobi's Wilson Airport on July 1, 2012

The attack by suspected Islamist militants on two churches in eastern Kenya on Sunday, in which the assailants killed 17 people and wounded 60 more, is more bloody confirmation of the emergence of African terrorist groups. A group of seven masked men threw grenades into the Catholic Church and African Inland Church in Garissa, close to the Somali border, then opened fire with assault rifles. Though no group has claimed responsibility, it is the latest incident after a series of attacks carried out by Islamist militants across Kenya that have killed close to 60 people. The episodes began after Kenya invaded Somalia last September in pursuit of the Somali guerrilla group al-Shabab.

For years Western terrorist hunters have war-gamed a scenario whereby al-Qaeda, pressed in Afghanistan and Pakistan, tries to establish a new staging ground in the Sahara and the Sahel, the band of lawless desert and scrub running east to west across Africa. According to the theory, al-Qaeda would likely try to extend its franchise to three indigenous African groups: al-Qaeda in the Islamic Maghreb (AQIM) in Algeria, Mali and Niger; Boko Haram in northern Nigeria; and al-Shabab in Somalia.

Theory is now becoming reality. After gestating for years, all three groups now present a real threat. Formerly a mostly criminal enterprise kidnapping foreigners for million-dollar ransoms, in the past year AQIM strengthened its arsenal with weapons smuggled out of the collapse of Muammar Gaddafi’s Libya, then piggybacked on a Tuareg rebellion in northern Mali so effectively that it and its fellow Islamists now control a de facto new state. (In a move similar to the Afghan Taliban’s demolition of Buddhist statues, some of the militants have now set about destroying “idolatrous” Sufi shrines in the ancient city of Timbuktu.) In Nigeria, most of Boko Haram’s attacks have a local focus — the security forces, state institutions, churches — but a faction has emerged with bigger ambitions, as it demonstrated with a suicide car-bomb attack on Aug. 26 last year on the U.N.’s headquarters in the Nigerian capital, Abuja, which killed 24 people and injured 115.

(PHOTOS: Government Forces Lay Claim to Mogadishu)

AQIM and Boko Haram represent a regional threat: according to U.S. and Nigerian intelligence, AQIM has trained Boko Haram operatives since the middle of the past decade. In spite of that, it is al-Shabab that garners the most attention from Western counterterrorism efforts, not least because Islamic terrorism has a long history in East Africa. It was the Aug. 7, 1998, U.S. embassy bombings in Nairobi and Dar es Salaam, Tanzania, in which 224 people died and which was carried out by another al-Qaeda affiliate based in Somalia, that gave first notice to the world that a previously little-known Saudi fundamentalist called Osama bin Laden, who lived in the Sudanese capital, Khartoum, for five years in the 1990s, was making good on his 1996 and ’98 declarations of a global jihad against the U.S. Al-Shabab was originally the armed wing of the Islamic Courts Union (ICU), an alliance of clerics and judges that tolerated the presence of the embassy bombers in its ranks and briefly ruled Mogadishu for six months in 2006. When an ICU leader declared a jihad on neighboring Ethiopia in October 2006, Ethiopia invaded, toppled the ICU and the group faded. But al-Shabab, by presenting itself as a force for nationalist resistance, gained strength and by 2008 was operating across much of Mogadishu and all of southern Somalia. Encouraged by the al-Qaeda operatives in its midst, it declared an alliance with bin Laden’s group. It also drew 200 to 250 foreigners to Somalia to join it, mainly ethnic Somali from the U.S., Britain, Europe and Australia but also itinerant jihadists from across the Middle East and South Asia. Finally, according to Nigerian intelligence, it also made tentative contact with Boko Haram.

All of which would put al-Shabab at the top of any Western intelligence service’s Africa watch list. But al-Shabab also has a proven will and ability to operate internationally. In 2008, it killed 30 people in a series of bombings in Somaliland. When the Ethiopians were replaced by Ugandans and Burundians sent in as an African Union peacekeeping force from 2007 to ’09, al-Shabab switched targets. On July 11, 2010, as the world watched Spain beat the Netherlands in the soccer World Cup final, two al-Shabab suicide bombers wearing vests stuffed with plastic explosives and ball bearings blew themselves up while surrounded by crowds watching the game in front of two separate outdoor screens in the Ugandan capital, Kampala. A total of 76 people died, mostly Ugandans, but also Ethiopians, Eritreans and a 25-year-old American, Nate Henn, of Wilmington, Del., from the San Diego activist group Invisible Children. After the Kenyan invasion last September, Kenya too became a target. The Islamists have staged grenade and bomb attacks in Nairobi, Mombasa, Garissa and elsewhere.

Inside Somalia, where al-Shabab operates as a conventional guerrilla army, the Islamists are losing territory to the African Union Mission in Somalia (AMISOM), which takes Ugandan and Burundian forces, and also soldiers from Djibouti, Sierra Leone and, since it agreed to a common command last month, Kenya. But al-Shabab’s steady loss of territory inside Somalia contrasts with its operations outside it where, as a terrorist group, it grows ever more bold and bloody. A TIME investigation into the Western counterterrorism response in East Africa offers some explanation as to why.

MORE: Threat Level Rising: How African Terrorist Groups Inspired by al-Qaeda Are Gaining Strength