al-Qaeda has had five distinct phases in its development: its beginnings in the late 1980s, a "wilderness" period in 1990–1996, its "heyday" in 1996–2001, a network period from 2001 to 2005, and a period of fragmentation from 2005 to 2009.

Background (late 1980s)

Afghan mujahideen

The origins of al-Qaeda can be traced to the Soviet War in Afghanistan (December 1979February 1989). The United States viewed the conflict in Afghanistan in terms of the Cold War, with Marxists on one side and the native Afghan mujahideen on the other. This view led to a CIA program called Operation Cyclone, which channeled funds through Pakistan's Inter-Services Intelligence agency to the Afghan mujahideen. The US government provided substantial financial support to the Afghan Islamic militants. Aid to Gulbuddin Hekmatyar, an Afghan mujahideen leader and founder of the Hezb-e Islami, amounted to more than $600million. In addition to American aid, Hekmatyar was the recipient of Saudi aid.Bergen, Peter L., Holy war, Inc.: inside the secret world of Osama bin Laden, New York: Free Press, 2001. pp. 68–x69 In the early 1990s, after the US had withdrawn support, Hekmatyar "worked closely" with bin Laden.Bergen, Peter L., Holy war, Inc.: Inside the Secret World of Osama bin Laden, New York: Free Press, 2001., pp. 70–71

At the same time, a growing number of Arab mujahideen joined the jihad against the Afghan Marxist regime, which was facilitated by international Muslim organizations, particularly the Maktab al-Khidamat (MAK), also known as the "Services Bureau". Muslim Brotherhood networks affiliated with the Egyptian Islamist Kamal al-Sananiri (d. 1981) played the major role in raising finances and Arab recruits for the Afghan Mujahidin. These networks included Mujahidin groups affiliated with Afghan commander Abd al-Rasul Sayyaf and Abdullah Yusuf Azzam, a Palestinian Islamist scholar and major figure in the Jordanian Muslim Brotherhood. Following the detention and death of Sananiri in an Egyptian security prison in 1981, Abdullah Azzam became the chief arbitrator between the Afghan Arabs and Afghan mujahideen.

As part of providing weaponry and supplies for the cause of Afghan Jihad, Usama bin Laden was sent to Pakistan as a Muslim Brotherhood representative to the Islamist organisation Jamaat-e-Islami. While in Peshawar, bin Laden met Abdullah Azzam and the two of them jointly established the Maktab al-Khidamat (MAK) in 1984; with objective of raising funds and recruits for Afghan Jihad across the world. MAK organized guest houses in Peshawar, near the Afghan border, and gathered supplies for the construction of paramilitary training camps to prepare foreign recruits for the Afghan war front. MAK was funded by the Saudi government as well as by individual Muslims including Saudi businessmen.. Bin Laden also became a major financier of the mujahideen, spending his own money and using his connections to influence public opinion about the war.. Quotes taken from and . Many disgruntled members of the Syrian Muslim Brotherhood like Abu Mussab al-Suri also began joining these MAK networks; following the crushing of Islamic revolt in Syria in 1982.

From 1986, MAK began to set up a network of recruiting offices in the US, the hub of which was the Al Kifah Refugee Center at the Farouq Mosque on Brooklyn's Atlantic Avenue. Among notable figures at the Brooklyn center were "double agent" Ali Mohamed, whom FBI special agent Jack Cloonan called "bin Laden's first trainer",Cloonan Frontline interview, PBS, July 13, 2005. and "Blind Sheikh" Omar Abdel-Rahman, a leading recruiter of mujahideen for Afghanistan. Azzam and bin Laden began to establish camps in Afghanistan in 1987..

MAK and foreign mujahideen volunteers, or "Afghan Arabs", did not play a major role in the war. While over 250,000 Afghan mujahideen fought the Soviets and the communist Afghan government, it is estimated that there were never more than two thousand foreign mujahideen on the field at any one time.. Nonetheless, foreign mujahideen volunteers came from 43 countries, and the total number who participated in the Afghan movement between 1982 and 1992 is reported to have been 35,000. Bin Laden played a central role in organizing training camps for the foreign Muslim volunteers."Who Is Osama Bin Laden?". Forbes. September 14, 2001."Frankenstein the CIA created". January 17, 1999. The Guardian.

The Soviet Union withdrew from Afghanistan in 1989. Mohammad Najibullah's Communist Afghan government lasted for three more years, before it was overrun by elements of the mujahideen.

Alleged CIA contacts with al-Qaeda

Experts debate the notion that the al-Qaeda attacks were an indirect consequence of the American CIA's Operation Cyclone program to help the Afghan mujahideen. Robin Cook, British Foreign Secretary from 1997 to 2001, wrote in 2005 that al-Qaeda and bin Laden were "a product of a monumental miscalculation by western security agencies", and claimed that "Al-Qaida, literally 'the database', was originally the computer file of the thousands of mujahideen who were recruited and trained with help from the CIA to defeat the Russians."

Munir Akram, Permanent Representative of Pakistan to the United Nations from 2002 to 2008, wrote in a letter published in The New York Times on January 19, 2008:

CNN journalist Peter Bergen, Pakistani ISI Brigadier Mohammad Yousaf, and CIA operatives involved in the Afghan program, such as Vincent Cannistraro, deny that the CIA or other American officials had contact with the foreign mujahideen or bin Laden, or that they armed, trained, coached or indoctrinated them. In his 2004 book Ghost Wars, Steve Coll writes that the CIA had contemplated providing direct support to the foreign mujahideen, but that the idea never moved beyond discussions.

Bergen and others argue that there was no need to recruit foreigners unfamiliar with the local language, customs or lay of the land since there were a quarter of a million local Afghans willing to fight. Bergen further argues that foreign mujahideen had no need for American funds since they received several million dollars per year from internal sources. Lastly, he argues that Americans could not have trained the foreign mujahideen because Pakistani officials would not allow more than a handful of them to operate in Pakistan and none in Afghanistan, and the Afghan Arabs were almost invariably militant Islamists reflexively hostile to Westerners whether or not the Westerners were helping the Muslim Afghans.

According to Bergen, who conducted the first television interview with bin Laden in 1997: the idea that "the CIA funded bin Laden or trained bin Laden... [is] a folk myth. There's no evidence of this... Bin Laden had his own money, he was anti-American and he was operating secretly and independently... The real story here is the CIA didn't really have a clue about who this guy was until 1996 when they set up a unit to really start tracking him."

Jason Burke also wrote:

After Afghanistan Toward the end of the Soviet-Afghan war, some foreign mujahideen wanted to expand their operations to include Islamist struggles in other parts of the world, such as Palestine and Kashmir. A number of overlapping and interrelated organizations were formed, to further those aspirations. One of these was the organization that would eventually be called Al-Qaeda.

Research suggests that al-Qaeda was formed on August 11, 1988, when a meeting in Afghanistan between leaders of Egyptian Islamic Jihad, Abdullah Azzam, and bin Laden took place.Final Report of the National Commission on Terrorist Attacks Upon the United States, Chapter on Terrorist Financing, 9/11 Commission Report p. 104 The network was founded in 1988. by Osama bin Laden, Abdullah Azzam, and other Arab volunteers during the Soviet–Afghan War. An agreement was reached to link bin Laden's money with the expertise of the Islamic Jihad organization and take up the jihadist cause elsewhere after the Soviets withdrew from Afghanistan.. After fighting the "holy" war, the group aimed to expand such operations to other parts of the world, setting up bases in parts of Africa, the Arab world and elsewhere, carrying out many attacks on people whom it considers kāfir.Jihadi Terrorism and the Radicalisation Challenge: p.219, Rik Coolsaet2011

Notes indicate Al-Qaeda was a formal group by August 20, 1988. A list of requirements for membership itemized the following: listening ability, good manners, obedience, and making a pledge (Bay'at) to follow one's superiors.. In his memoir, bin Laden's former bodyguard, Nasser al-Bahri, gives the only publicly available description of the ritual of giving bay'at when he swore his allegiance to the Al-Qaeda chief.Al-Bahri, Nasser, Guarding bin Laden: My Life in al-Qaeda. p. 123. Thin Man Press. London. According to Wright, the group's real name was not used in public pronouncements because "its existence was still a closely held secret.".

After Azzam was assassinated in 1989 and MAK broke up, significant numbers of MAK followers joined bin Laden's new organization.

In November 1989, Ali Mohamed, a former special forces sergeant stationed at Fort Bragg, North Carolina, left military service and moved to California. He traveled to Afghanistan and Pakistan and became "deeply involved with bin Laden's plans.". In 1991, Ali Mohammed is said to have helped orchestrate bin Laden's relocation to Sudan.

Beginnings (1990-2001)

Gulf War and the start of US enmity

Following the Soviet Union's withdrawal from Afghanistan in February 1989, bin Laden returned to Saudi Arabia. Thrilled by his successes in Afghan jihad, bin Laden turned his anti-communist posture towards South Yemen and requested Saudi authorities to lead an armed Jihad against communist South Yemen. However, the Saudi Intelligence chief Turki bin Faisal rebuffed bin Laden's offers, insisting on waiting for the collapse of the unstable communist regime. This led to the first major dispute of bin Laden with the Saudi monarchy.

The Iraqi invasion of Kuwait in August 1990 had put the Kingdom and its ruling House of Saud at risk. The world's most valuable oil fields were within striking distance of Iraqi forces in Kuwait, and Saddam's call to Pan-Arabism could potentially rally internal dissent. In the face of a seemingly massive Iraqi military presence, Saudi Arabia's own forces were outnumbered. Bin Laden offered the services of his mujahideen to King Fahd to protect Saudi Arabia from the Iraqi army. The Saudi monarch refused bin Laden's offer, opting instead to allow US and allied forces to deploy troops into Saudi territory. The arrival of American troops to the Kingdom in August 1990 was heavily condemned by bin Laden.

The deployment angered bin Laden, as he believed the presence of foreign troops in the "land of the two mosques" (Mecca and Medina) profaned sacred soil. King Fahd's refusal of bin Laden's offer to train the Mujahidin; instead giving permission for American soldiers to enter Saudi territory in order to repel Saddam Hussein's forces would greatly anger bin Laden. The entry of American troops into Saudi Arabia was denounced by bin Laden as a "Crusader attack on Islam" that defiled the sacred lands of Islam. He asserted that the Arabian Peninsula has been "occupied" by foreign invaders and excommunicated the Saudi regime due to its complicity with United States. After relentless criticism of the Saudi government for harboring American troops and rejecting their legitimacy, he was banished in 1991 and forced to live in exile in Sudan. Bin Laden also vehemently denounced the elder Wahhabi scholarship; most notably Grand Mufti Abd al-Azeez Ibn Baz, accusing him of partnering with infidel forces due to his fatwa that permitted the entry of US troops.

In Sudan