Afghanistan has existed as a distinct polity for less than three centuries. Previously, the area was made up of various principalities, usually hostile to each other and occasionally ruled by one or another conqueror from Persia and the area to the west or from central Asia to the north, usually on his way to India. These included the Persian Darius I in the 6th century BC , and 300 years later, Alexander the Great. As the power of his Seleucid successors waned, an independent Greek kingdom of Bactria arose with its capital at Balkh west of Mazar-i-Sharif, but after about a century it fell to invading tribes (notably the Sakas, who gave their name to Sakastan, or Sistan). Toward the middle of the 3rd century BC , Buddhism spread to Afghanistan from India, and for centuries prior to the beginning of the 9th century AD , at least half the population of eastern Afghanistan was Buddhist.
Beginning in the 7th century, Muslim invaders brought Islam to the region, and it eventually became the dominant cultural influence. For almost 200 years, Ghazni was the capital of a powerful Islamic kingdom, the greatest of whose rulers, Mahmud of Ghazni (r.997-1030), conquered most of the area from the Caspian to the Ganges. The Ghaznavids were displaced by the Seljuk Turks, who mastered Persia and Anatolia (eastern Turkey), and by the Ghorids, who, rising from Ghor, southeast of Herat, established an empire stretching from Herat to Ajmir in India. They were displaced in turn by the Turko-Persian rulers of the Khiva oasis in Transoxiana, who, by 1217, had created a state that included the whole of Afghanistan until it disintegrated under attack by Genghis Khan in 1219. His grandson Timur, also called "Timur the Lame" or Tamerlane, occupied all of what is now Afghanistan from 1365 to 1384, establishing a court of intellectual and artistic brilliance at Herat. The Timurids came under challenge from the Uzbeks, who finally drove the them out of Herat in 1507. The great Babur, one of the Uzbek princes, occupied Kabul in 1504 and Delhi in 1526, establishing the Mughal Empire in which eastern Afghanistan was ruled from Delhi, Agra, Lahore, or Srinagar, while Herat and Sistan were governed as provinces of Persia.
In the 18th century, Persians under Nadir Shah conquered the area, and after his death in 1747, one of his military commanders, Ahmad Shah Abdali, was elected emir of Afghanistan. The formation of a unified Afghanistan under his emirate marks Afghanistan's beginning as a political entity. Among his descendants was Dost Muhammad who established himself in Kabul in 1826 and gained the emirate in 1835. Although the British defeated Dost in the first Afghan War (1838-42), they restored him to power, but his attempts and those of his successors to play off Czarist Russian interests against the British concerns about the security of their Indian Empire led to more conflict. In the second Afghan War (1877–79), the forces of Sher Ali, Dost's son, were defeated by the British, and his entire party, ousted. Abdur Rahman Khan, recognized as emir by the British in 1880, established a central administration, and supported the British interest in a neutral Afghanistan as a buffer against the expansion of Russian influence.
Intermittent fighting between the British and Pushtun tribes from eastern Afghanistan continued even after the establishment, in 1893, of a boundary (the Durand line) between Afghanistan and British India. An Anglo-Russian agreement concluded in 1907 guaranteed the independence of Afghanistan (and Tibet) under British influence, and Afghanistan remained neutral in both World Wars. Afghan forces under Amanullah Khan, who had become emir in 1919, briefly intruded across the Durand Line in 1919. At the end of brief fighting—the third Afghan War—the Treaty of Rawalpindi (1919) accorded the government of Afghanistan the freedom to conduct its own foreign affairs.
Internally, Amanullah's Westernization program was strongly opposed, forcing him to abdicate in 1929. After a brief civil war, a tribal assembly chose Muhammad Nadir Shah as king. In his brief four years in power, he restored peace while continuing Amanullah's modernization efforts at a more moderate pace. Assassinated in 1933, he was succeeded by his son, Muhammad Zahir Shah, who continued his modernization efforts, governing for 40 years, even though sharing effective power with his uncles and a first cousin, who served as his prime ministers.
In the 1960s, there was considerable tension between Pakistan and Afghanistan as a result of Afghanistan's effort to assert influence among, and ultimately responsibility for, Pushtu-speaking Pathan tribes living on both sides of the Durand Line under a policy calling for the establishment of an entity to be called "Pushtunistan." The border was closed several times during the following years, and relations with Pakistan remained generally poor until 1977.
In 1964, a new constitution was introduced, converting Afghanistan into a constitutional monarchy, and a year later the country's first general election was held. In July 1973, Muhammad Daoud Khan, the king's first cousin and brother-in-law, who had served as prime minister from 1953 until early 1963, seized power in a near-bloodless coup, establishing a republic and appointing himself president, and prime minister of the Republic of Afghanistan. He exiled Zahir Shah and his immediate family, abolished the monarchy, dissolved the legislature, and suspended the constitution. Daoud ruled as a dictator until 1977, when a republican constitution calling for a one-party state was adopted by the newly convened Loya Jirga (Grand National Assembly), which then elected Daoud president for a six-year term.
On 27 April 1978, Daoud was deposed and executed in a bloody coup (the "Saur Revolution" because it took place during the Afghan month of Saur), and the Democratic Republic of Afghanistan emerged. Heading the new Revolutionary Council was Nur Muhammad Taraki, secretary-general of the communist People's Democratic Party of Afghanistan (PDPA), assisted by Babrak Karmal and Hafizullah Amin, both named deputy prime ministers. The former Soviet Union immediately established ties with the new regime, and in December 1978, the two nations concluded a treaty of friendship and cooperation. Soon after the coup, rural Afghan groups took up arms against the regime, which increasingly relied on Soviet arms for support against what came to be known as mujahidin, or holy warriors.
Meanwhile, the Khalq (masses) and Parcham (flag) factions of the PDPA, which had united for the April takeover, became embroiled in a bitter power struggle within the party and the government. In September 1979, Taraki was ousted and executed by Amin, who had beat out Karmal to become prime minister the previous March and who now assumed Taraki's posts as president and party leader. Amin was himself replaced on 27 December by Karmal, the Parcham faction leader. This last change was announced not by Radio Kabul but by Radio Moscow and was preceded by the airlift of 4,000 to 5,000 Soviet troops into Kabul on 25–26 December, purportedly at the request of an Afghan government whose president, Hafizullah Amin, was killed during the takeover.
The Soviet presence increased to about 85,000 troops in late January 1980, and by spring, the first clashes between Soviet troops and the mujahidin had occurred. Throughout the early and mid-1980s, the mujahidin resistance continue to build, aided by Afghan army deserters and arms from the United States, Pakistan, and the nations of the Islamic Conference Organization (ICO). Much of the countryside remained under mujahidin control as the insurgency waged on year by year, while in Kabul, Soviet advisers assumed control of most Afghan government agencies.
By late 1987, more than a million Afghans had lost their lives in the struggle, while the United Nations High Commission for Refugees (UNHCR) estimated that some 5 million others had sought refuge in Pakistan, Iran, and elsewhere. Soviet sources at the time acknowledged Soviet losses of between 12,000 and 30,000 dead and 76,000 wounded. Soviet troop strength in Afghanistan at the end of 1987 was about 120,000, while according to Western sources, Afghan resistance forces numbered nearly 130,000.
In early 1987, Babrak Karmal fled to Moscow after being replaced as the head of the PDPA in May 1986 by Najibullah, former head of the Afghan secret police. Najibullah offered the mujahidin a ceasefire and introduced a much publicized national reconciliation policy; he also released some political prisoners, offered to deal with the resistance leaders, and promised new land reform. The mujahidin rejected these overtures, declining to negotiate for anything short of Soviet withdrawal and Najibullah's removal.
International efforts to bring about a political solution to the war—including nearly unanimous General Assembly condemnations of the Soviet presence in Afghanistan—were pursued within the UN framework from 1982 onward. Among these efforts were "proximity talks" between Afghanistan and Pakistan conducted by a Special Representative of the UN Secretary General, Under Secretary-General Diego Cordovez. After a desultory beginning, these talks began to look promising in late 1987 and early 1988 when Soviet policymakers repeatedly stated, in a major policy shift, that the removal of Soviet troops from Afghanistan was not contingent on the creation of a transitional regime acceptable to the former USSR. On 14 April 1988, documents were signed and exchanged in which the USSR agreed to pull its troops out of Afghanistan within nine months, the US reserved the right to continue military aid to Afghan guerrillas as long as the USSR continued to aid the government in Kabul, and Pakistan and Afghanistan pledged not to interfere in each other's internal affairs.
The Russians completed the evacuation of their forces on schedule 15 February 1989, but in spite of continuing pressure by the well-armed mujahidin, the Najibullah government remained in power until April 1992, when Najibullah sought refuge at the UN office in Kabul as mujahidin forces closed in on the city.
With the fall of the Najibullah government, the Seven-Party Alliance (SPA) of the Islamic groups based in Pakistan moved to consolidate its "victory" by announcing plans to set up an Interim Afghan Government (AIG) charged with preparing the way for elections. Meanwhile, they moved to assert their control of Afghanistan, but their efforts to establish the AIG in Kabul failed when within ten days of Najibullah's departure from office, well-armed forces of the Hizb-i-Islami and Jamiat-i-Islami—two of the seven SPA parties—clashed in fighting for the control of the capital. In July, Jamiat leader Burhanuddin Rabbani replaced Sibghatullah Mojaddedi as president of the AIG, as previously agreed by all the SPA parties but the Hizb-i-Islami.
Continued fighting between Jamiat and Hizb-i-Islami militias halted further progress, and Rabbani's forces, under Commander Ahmad Shah Masoud, dug in to block those under the control of interim "Prime Minister" Gulbuddin Hekmatyar's Hizb-i-Islami and his ally, General Rashid Dostum (a former PDPA militia leader turned warlord from northern Afghanistan), from taking control of Kabul. In a 24-hour rocket exchange in August 1992 in Kabul, an estimated 3000 Afghans died, and before the end of the year, upwards of 700,000 Afghans had fled the city. Deep differences among the SPA/AIG leadership, embittered by decades of bad blood, ethnic distrust, and personal enmity, prevented any further progress toward creating a genuine interim government capable of honoring the 1992 SPA pledge to write a constitution, organize elections, and create a new Afghan polity. Despite UN attempts to broker a peace and bring the warring groups into a coalition government, Afghanistan remained at war.
By the summer of 1994 Rabbani and his defense minister, Ahmed Shah Masoud, were in control of the government in Kabul, but internal turmoil caused by the warring factions had brought the economy to a standstill. It was reported that on the road north of Kandahar a convoy owned by influential Pakistani businessmen was stopped by bandits demanding money. The businessmen appealed to the Pakistani government, which responded by encouraging Afghan students from the fundamentalist religious schools on the Pakistan-Afghan boarder to intervene. The students freed the convoy and went on to capture Kandahar, Afghanistan's second-largest city. Pakistan's leaders supported the Taliban with ammunition, fuel, and food. The students, ultra-fundamentalist Sunni Muslims who called themselves the Taliban (the Arabic word for religious students, literally "the Seekers") shared Pashtun ancestry with their Pakistani neighbors to the south. The Taliban also found widespread support among Afghan Pashtuns hostile to local warlords and tired of war and economic instability. By late 1996, the Taliban had captured Kabul, the capital, and were in control of 21 of Afghanistan's 32 provinces. When Rabbani fled the capital, Pakistan and Saudi Arabia officially recognized the Taliban government in Kabul. In areas under Taliban control, order was restored, roads opened, and trade resumed. However, the Taliban's reactionary social practices, justified as being Islamic, did not appeal to Afghanistan's non-Pashtun minorities in the north and west of the country, nor to the educated population generally. The opposition, dominated by the Uzbek, Tajik, Hazara, and Turkoman ethnic groups, retreated to the northeastern provinces.
In May 1997 the Taliban entered Mazar-i-Sharif, Afghanistan's largest town north of the Hindu Kush and stronghold of Uzbek warlord Rashid Dostum. In the political intrigue that followed, Dostum was ousted by his second in command, Malik Pahlawan, who initially supported the Taliban. Dostum reportedly fled to Turkey. Once the Taliban were in the city, however, Pahlawan abruptly switched sides. In the subsequent fighting, the Taliban were forced to retreat with heavy casualties. The forces of Ahmad Shah Masoud, Tajik warlord and former defense minister in ousted President Rabbani's government, were also instrumental in the defeat of the Taliban in Mazar. Masoud controlled the high passes of the Panjshir Valley in the east of the country. The opposition alliance was supported by Iran, Russia, and the Central Asian republics, who feared that the Taliban might destabilize the region.
By early 1998, the Taliban militia controlled about two-thirds of Afghanistan. Opposition forces under Ahmad Shah Masoud controlled the northeast of the country. Taliban forces mounted another offensive against their opponents in August-September 1998 and nearly sparked a war with neighboring Iran after a series of Shiite villages were pillaged and Iranian diplomats killed. Iran, which supplied Masoud's forces, countered by massing troops along its border with Afghanistan. Although the crisis subsided, tensions between the Taliban and Iran remained high. Masoud's opposition forces became known as the United Front or Northern Alliance in late 1999.
Despite attempts to broker a peace settlement, fighting between the Taliban and opposition factions continued through 1999 and into 2000 with the Taliban controlling 90% of the country. In March 1999, the warring factions agreed to enter a coalition government, but by July these UN-sponsored peace talks broke down and the Taliban renewed its offensive against opposition forces. By October, the Taliban captured the key northern city of Taloqan and a series of northeastern towns, advancing to the border with Tajikistan. Fighting between the Taliban and Northern Alliance forces was fierce in early 2001.
In April 2001, Masoud stated that he did not rule out a peace dialogue with the Taliban, or even of setting up a provisional government jointly with the Taliban, but that Pakistan would have to stop interfering in the conflict first. He stated that elections would have to be held under the aegis of the UN and the "six plus two" countries, including Iran, China, Pakistan, Tajikistan, Turkmenistan, as well as Russia and the US. The Northern Alliance was receiving financial and military assistance from its old enemy Russia as well as from Iran. In addition to Pakistan, the Taliban was recognized as the legitimate government of Afghanistan by Saudi Arabia and the United Arab Emirates. Masoud was assassinated on 9 September 2001, by two men claiming to be Moroccan journalists. His killers are thought to have been agents of al-Qaeda acting in concert with the plotters of the 11 September 2001 attack on the World Trade Center in New York and the Pentagon in Washington, D.C.
The 11 September 2001 attacks carried out against the US by members of al-Qaeda marked the beginning of a war on terrorism first directed against the Taliban for harboring Osama bin Laden and his forces. On 7 October 2001, US-led forces launched the bombing campaign Operation Enduring Freedom against the Taliban and al-Qaeda in Afghanistan. On 13 November the Taliban were removed from power in Kabul, and an interim government under the leadership of Hamid Karzai, a Pashtun leader from Kandahar, was installed on 22 December. The campaign continued, however, into 2002. In June 2002, a Loya Jirga, or Grand Assembly of traditional leaders, was held, and Karzai was elected head of state of a transitional government that would be in place for 18 months until elections could be held. More than 60% of the cabinet posts in the government went to Ahmed Shah Masoud's Northern Alliance. Masoud was officially proclaimed the national hero of Afghanistan on 25 April 2002. A special committee collected signatures to award the Nobel Prize to Masoud posthumously. Among those who signed the petition were Czech President Vaclav Havel, American writer Elie Wiesel, and deputies of the European Parliament. On 5 September 2002, Karzai survived an assassination attempt, and another plot against him was thwarted on 22 November. As of April 2003, more than 10,000 coalition forces, led by 8,000 US troops, were engaged in fighting remnants of the Taliban, al-Qaeda forces, and former mujahidin commander Gulbuddin Hekmatyar, in the eastern and southern regions of Afghanistan.