Although Malala's memoir primarily deals with the its occupation of Swat Valley in Pakistan, the Taliban first came to power in Pakistan's neighbor to the west, Afghanistan. Malala points out that the Pashtun people span across the border between these two countries, so the affairs of Afghanistan were always relevant to the Pashtun people of Swat Valley. The following is a brief history of the Taliban's occupation of Afghanistan.
The Taliban was formed in the early 1990s by Islamic fighters who had resisted the Soviet invasion of Afghanistan throughout the 1980s, as well as younger Pashtun students; taliban is Pashto for "student." The organization was attractive to the people of Afghanistan because it promised stability after a turbulent decade. Its occupation began with the southern city of Kandahar in November 1994, and by September of 1996 the Taliban was able to seize the capital of Afghanistan, Kabul, from President Rabbani. By its overthrow in 2001, it controlled more than 90 percent of the country.
The core of the Taliban was its rule of law and its particularly brutal justice system. It imposed a strict version of sharia law, outlawing things like television and music and even imprisoning men who did not have proper facial hair. Its treatment of women was particularly severe, requiring that women wear a head-to-toe burqa and permitting the abuse of women who did not abide by their laws. The Afghanistan Taliban also did not provide any social services or complete any other state functions that a different government would.
International response to the Taliban regime was to isolate the country for its human rights abuses. The UN Security Council imposed sanctions on the regime for the protection of al-Qaeda terrorists. The Taliban government was only recognized by three states: Pakistan, the United Arab Emirates, and Saudi Arabia; however, following September 11, 2001, the UAE and Saudi Arabia withdrew diplomatic relations, leaving Pakistan the only country who recognized the Taliban.
Following the 9/11 attacks, the United States and its allies initiated military action in an attempt to remove the Taliban from power in order to prevent the use of Afghanistan as a terrorist base. After struggle, the Taliban retreated from Kabul on November 12, and by December they had given up their last stronghold. The Taliban experienced a resurgence around the year 2006, which led to the occupation of Northeastern Pakistan, as detailed in Malala's memoir.