Ahmad Shah DURRANI unified the Pashtun tribes and founded Afghanistan in 1747. The country served as a buffer between the British and Russian empires until it won independence from notional British control in 1919. A brief experiment in democracy ended in a 1973 coup and a 1978 Communist counter-coup. The Soviet Union invaded in 1979 to support the tottering Afghan Communist regime, but withdrew 10 years later under relentless pressure by internationally supported anti-Communist mujahedin rebels. A civil war between mujahedin factions erupted following the 1992 fall of the Communist regime. The Taliban, a hardline Pakistani-sponsored movement that emerged in 1994 to end the country's civil war and anarchy, seized Kabul in 1996 and most of the country outside of opposition Northern Alliance strongholds by 1998. Following the 11 September 2001 terrorist attacks, a US, Allied, and Northern Alliance military action toppled the Taliban for sheltering Osama BIN LADIN. In late 2001, a conference in Bonn, Germany, established a process for political reconstruction that included the adoption of a new constitution in 2003, a presidential election in 2004, and National Assembly elections in 2005. On 9 October 2004, Hamid KARZAI became the first democratically elected president of Afghanistan. The National Assembly was inaugurated on 19 December 2005.