Al-Qaeda has operated in Africa since the early 1990s. It has carried out operations and conducted recruitment across the continent in Sudan, Kenya, Algeria, Somalia, Libya and other countries.

From 1991 to 1996, Osama bin Laden and other al-Qaeda leaders were based in Sudan before moving to Taliban ruled Afghanistan.

The major al-Qaeda branches currently operating across Africa are al-Qaeda in the Islamic Maghreb, Harakat al-Shabaab al-Mujahideen and Jama'at Nasr al-Islam wal-Muslimin.

Background In 1994, near the end of the Soviet–Afghan War, an Islamist militant group known as al-Qaeda was established by Afghan Arabs, led by Osama bin Laden from Saudi Arabia, who had fought alongside the Afghan mujahideen. After the Soviet withdrawal, the Afghan Civil War erupted. While some Arab fighters stayed in Afghanistan, most left the country, often finding themselves unwelcome by their home nations government. Many settled in neighboring Pakistan, while others joined conflicts in Kashmir, Bosnia, or Chechnya. Several al-Qaeda members quietly resided in Africa for years after receiving training in Afghanistan, forming part of a new network of sleeper cells established across the globe.

At the same time as the Soviet–Afghan War was concluding, the East African country of Sudan had a military coup in 1989. Though headed by Sudanese army Colonel Omar al-Bashir, the Islamist politician Hassan al-Turabi of the National Islamic Front (NIF) was the prime mover and sought to create an Islamic order in Sudan. Turabi declared solidarity with oppressed Muslims worldwide and invited Islamic groups such as Hamas and Hezbollah to have a safe base in Sudan.

Sudan In 1990, the National Islamic Front, the ruling party in Sudan led by Hassan al-Turabi, invited Osama bin Laden to relocate to the country. In Sudan, bin Laden sought to emulate his father, Muhammad bin Ladin, a prominent businessman and road builder in Saudi Arabia. Turabi, envisioned Sudan as the headquarters for an international Islamic revolution, and so welcomed bin Laden as "the great Islamic investor" as he opened the country to Muslims from around the world. After meeting with Sudanese intelligence officials, bin Laden dispatched associates to explore business opportunities in Sudan. Al-Qaeda representatives were impressed with the prospects and encouraged bin Laden to move the organization there. Jamal al-Fadl, a Sudanese Al-Qaeda member, facilitated the purchase of large parcels of land and secured rental properties for the group. During this period, the Saudi Binladin Group secured a contract to build an airport in Port Sudan, a project that bin Laden personally oversaw during his frequent visits to the country.

In 1992, Osama bin Laden and his family relocated from Afghanistan to Khartoum, the capital of Sudan. Bin Laden announced plans to construct a 300-kilometer road in eastern Sudan, bringing extensive heavy construction equipment with him. Over the next several years, al-Qaeda established multiple businesses—including import/export ventures, farms, and construction firms—in what could be described as a period of financial consolidation. The group also constructed a significant 1,200-kilometer (745-mile) highway linking Khartoum to Port Sudan. Most of these projects were undertaken by bin Laden's construction company, al-Hijra. When the Sudanese government was unable to pay for these services, it compensated the company with plots of land. Journalist Lawrence Wright noted that during this time, "Al-Qaeda had become largely an agricultural organization." Bin Laden was captivated by the prospects of farming in the country and under his agricultural business al-Thimar al-Mubaraka became a major player in Sudanese farming. Eventually he enjoyed a near monopoly on Sudanese farming exports as he became one of the countries largest land owners. Bin Laden engaged al-Qaeda members in business operations and recreational activities, while maintaining low-level training programs, primarily refresher courses for veterans of the Afghanistan war. There were about 500 people in Sudan who worked for Bin Laden, though never more than 100 were active members of Al-Qaeda.

According to accounts from friends and associates of Osama bin Laden during this period, he had resolved to leave al-Qaeda and fully dedicate himself to the farming industry. He avoided involvement in the Second Sudanese Civil War, resisting pressure from al-Qaeda members who urged him to participate. Despite this shift in focus, bin Laden was at a crossroads and remained deeply troubled by the continued presence of the United States military in Saudi Arabia following the Gulf War. This presence persisted despite King Fahd's earlier pledge that the troops would leave once the conflict with Saddam Hussein had ended. Bin Laden agonized over what he viewed as the beginning of a "permanent occupation" of the holy land. In Sudan, Bin Laden did not go into hiding; he was highly visible and accessible in Khartoum, frequently lecturing at local mosques. The CIA observed that he often sat openly in the front yard of his home, speaking about Islam and jihad. They concluded that, at the time, Bin Laden was functioning primarily as a financier rather than an operative. While he was willing to fund and encourage Islamic groups to wage jihad, there was no evidence linking him directly to any attacks.

In 1994, several assassins targeted a Khartoum mosque where Bin Laden often preached, opening fire in a failed assassination attempt and killing several worshipers. The incident only served to elevate his stature among many Islamists. Though the Saudi government had banished Bin Laden from the country for his statements against King Fahad's policies. Until 1994, he continued to receive about a million dollars in annual allowance. That year he was cut off after he rejected pleas from emissaries of the king to apologize to him.

In 1996, Osama bin Laden was asked to leave Sudan after the United States put the regime under extreme pressure to expel him, citing possible connections to the 1994 attempted assassination of Egyptian President Hosni Mubarak while his motorcade was in Addis Ababa, Ethiopia. Osama bin Laden finally left Sudan in a well-executed operation, arriving at Jalalabad, Afghanistan by air in late 1996 with over 200 of his supporters and their families.

Algeria

The origins of Al-Qaeda Organization in the Islamic Maghreb (AQIM) lay in the Algerian Civil War. In 1992, conflict erupted between the government and Islamist factions, with the Armed Islamic Group of Algeria (GIA) emerging as the dominant force. In 1993, Osama bin Laden sent an Algerian al-Qaeda operative with $40,000 to meet rebel leaders. However, the extreme violence and international condemnation of the GIA's conduct alarmed al-Qaeda's leadership. When GIA leaders later visited Khartoum seeking additional funds, they criticized bin Laden as being "too flexible" with democrats, which enraged him and led to the withdrawal of al-Qaeda's support for the GIA entirely.

Between 1995 and 1999, internal divisions within the GIA led to the formation of the Salafi Group for Preaching and Combat (GSPC). The GSPC originated as a field commanders’ revolt against the central leadership of the GIA. It was significantly smaller than the GIA but was more cohesive and contact was reestablished between GSPC and Al-Qaeda after its break from the GIA. This relationship eventually culminated in the GSPC's pledge of allegiance to al-Qaeda in 2003, which would result in the formation of AQIM three-year later.

During the mid-2000s many members of the GSPC/AQIM went abroad to fight against American forces during the Iraq War. In 2006, GSPC renewed its pledge to allegiance to al-Qaeda, and in January 2007 it merged with the organization to form the Al-Qaeda Organization in the Islamic Maghreb. While AQIM maintained a presence in northern Algeria where the leadership was based and occasionally carried out attacks, the focus of the organization was in the Sahara. The leader of AQIM, Abdelmalek Droukdel of Algeria, formed a close relationship with Abu Musab al-Zarqawi, the leader of Al-Qaeda in Iraq and released statements in each other's support. AQIM adopted suicide bombings from Al-Qaeda in Iraq, which had hardly been used by the GIA during the civil war.

In the years following the formation of AQIM, government forces and military installations across the region—including in Algeria, Tunisia, Mali and other nations were repeatedly targeted. However, these attacks are often underreported in Western media. AQIM's strategic leadership is based in the mountainous Kabylie region of Algeria, where ethnic Berbers have long struggled with the central government for greater autonomy.

Kenya While al-Qaeda was based in Sudan during the early 1990s, the group's military chief, Abu Ubaidah al-Banshiri, established an East Africa cell. Operating under a new identity in Kenya, he married a local woman and posed as a mining businessman while preparing for al-Qaeda's "first great strike against America." The CIA had known followers of bin Laden had been operating in Nairobi, Kenya's capital, and the American Federal Bureau of Investigation (FBI) made several unannounced visits to the homes of suspected militants living in Kenya over the summer of 1997. Osama bin Laden's secretary, Wadih el-Hage, resided in the city. In August 1997, FBI and CIA officials searched el-Hage's home and uncovered evidence confirming al-Qaeda's existence. Although U.S. authorities suspected the organization was planning an operation, they believed it to be a low-level plot that had likely been abandoned following the discovery of the Nairobi safe house. Despite believe that they had disrupted al-Qaeda's East African cell, operatives trained in Afghanistan stayed behind and continued plotting to strike American targets.

During August 1998, Al-Qaeda carried out the United States embassy bombings in Kenya and Tanzania. In the aftermath of the attacks, with the US carried military strikes under Operation Infinite Reach in both Sudan and Afghanistan. Fax and satellite phone calls between Africa and Afghanistan along with electronic intercepts left little doubt in the CIA that Osama bin Laden had planned, funded and ordered the attacks. This represented the first time evidence existed that he had been responsible for the deaths of Americans.

In 2002 another successful terrorist attack in Kenya after the U.S. embassy bombing, a car bomb attack on a Mombasa resort hotel popular among Israeli tourists claimed the lives of 15 people. The hotel bombing occurred 20 minutes after a failed attack on an airplane, when a militant fired an SA-7 man-portable air-defense system against an Israeli airliner carrying 261 passengers, which was taking off from the airport; the missile seemingly failed to track its target, nor did it detonate, and landed in an empty field.

Tanzania Al-Qaeda's military chief Abu Ubaidah al-Banshiri, who was then based in Kenya, was killed traveling to Tanzania when the MV Bukoba sank in Lake Victoria only several days after Osama bin Laden had left Sudan for Afghanistan in 1996. After a raid of Osama bin Laden's secretary, Wadih el-Hage's safe house in Kenya during 1997, U.S. authorities discovered he had been making frequent trips to Tanzania.

During August 1998, Al-Qaeda carried out the United States embassy bombings in Kenya and Tanzania.

Libya Al-Qaeda Organization in the Islamic Maghreb currently has a presence in Libya that has been described as "wide but patchy". AQIM has territorial footholds from the southwestern desert up through the coastal northeast.