The first Afghan Empire was established under Ahmad Shah Abdali in 1747. He belonged to the Durrani tribe and was selected as the leader of the tribe by the elders in
Kandahar
. He proceeded to win Ghazni,
Kabul
,
Herat
, Mashad and even
Peshawar
; the first Afghan empire thus rose with
Kandahar
as its base. Ahmad Shah was also successful in winning over the Turk, Uzbek and Tajik areas of present day
Afghanistan
. He also concluded an agreement with the Amir of Bukhara in making the river
Amu Darya
as the natural boundary of
Afghanistan
in the north. (The Amir of Bukhara gifted him a cloak believed to be worn by the Prophet, which Mullah Omar, the current leader of the Taliban, held in front of the crowd in the 1990s to gain legitimacy).
The growth of the empire coincided with the decline of the Mughal Empire in
India
. Ahmad Shah's son, Timur Shah, succeeded him in 1772 and shifted the capital from
Kandahar
to
Kabul
as he was facing problems from his own tribes. The Afghan tribes were never united, which have been their greatest problem ever since they formed their first kingdom. Timur Shah was succeeded by Zaman Shah in 1793 and at the time of Timur Shah's death, the Afghan empire included all areas of
Afghanistan
south of
Hindu Kush
,
Herat
,
Balkh
and Khulm in addition to
Kashmir
,
Lahore
,
Multan
and
Peshawar
. It was during Timur Shah's period, the Great Game between the British and the Russians started evolving.
Zaman Shah could not control the entire empire and appointed Ranjit Singh as the Governor of Lahore in 1798. The British came to face the Afghans, for the first time during Zaman Shah's rule. Fearing a raid from Zaman Shah into
India
, Lord Wellesly, the Governor General of
British India
, requested the Persian ruler to make measures to keep Zaman Shah in perpetual check so as to prevent him from returning to
India
. After Zaman Shah, there arose a struggle between Dost Mohammad and Shuja Shah for the throne. The British sided with Shuja Shah and signed a Treaty of Mutual Defence with him against
Russia
in 1809 Shuja Shah.
The British forces captured
Kabul
, arrested Dost Mohammad and crowned Shuja Shah in August 1839. Dost Mohammad escaped from the prison and led the Afghan resistance against the British. The British troops could not hold
Kabul
and held discussions with Akbar Khan, Dost Mohammad's son, to withdraw from
Kabul
. In January 1842, the First Anglo-Afghan war began; 4,500 British and Indian troops, with 12,000 camp followers, were killed alongwith Shah Shuja. Though the British forces were able to reoccupy
Kabul
, the new Governor General, Lord Ellenborough, decided to withdraw from
Afghanistan
. Dost Mohammad became the ruler and consolidated his rule; he occupied
Kandahar
in 1855,
Balkh
in 1859 and
Herat
in 1863.
Sher Ali Khan succeeded Dost Mohammad and started moving close with the Russians. His refusal to receive a British mission and his meeting with a Russian mission resulted in the Second Anglo-Afghan War of 1878-80. The Treaty of Gandamak concluded between Yaqub Khan (son and the successor of Sher Ali Khan) and the British in May 1879 recognized Yaqub Khan as Amir. He agreed to receive a permanent British embassy at
Kabul
and conduct his foreign relations in accordance with the wishes and advice of the British Government.
In September 1879, the British envoy in
Kabul
was murdered, following which the British troops made Yaqub Khan to abdicate the throne. Abdur Rahman Khan ruled
Afghanistan
during 1880-1901, during which time the British and the Russians determined the boundaries of
Afghanistan
. The Durand Line was drawn in 1893 between
Afghanistan
and the
British India
;
Afghanistan
became a buffer state between Tsarist Russia and
British India
. Abdur Rahman Khan consolidated his rule inside
Afghanistan
and became the founder of modern
Afghanistan
.
Habibullah Khan succeeded Abdur Rahman and during his rule western culture started influencing the Afghan elites. Pro-British Habibullah was murdered by the anti-British group and Amanullah became the ruler in 1919. The Third Anglo-Afghan War broke out in 1919 and resulted in the Treaty of Rawalpindi being signed in August 1919. This let
Afghanistan
to conduct its foreign policy independent of the British.
During the same period,
Afghanistan
also concluded a Treaty of Friendship with the new Bolshevik Regime in the
Soviet Union
in May 1921. This resulted in a special relationship between the two governments that lasted until December 1979, when
Soviet Union
invaded
Afghanistan
.
Amanullah changed his title to King in 1923 and introduced constitutional and administrative reforms. Civil war broke out in November 1928 and resulted in Amanullah abdicating his throne. Mohammad Nadir Khan was elected as the Shah by the tribal assembly. Nadir Khan introduced a new more conservative constitution in 1931. After his assassination in 1933, his son, Mohammad Zahir Shah, succeeded him and ruled
Afghanistan
till 1973.