European influence in Afghanistan has been present in the country since the Victorian era, when the competing imperial powers of Britain and Russia contested for control over Afghanistan as part of the Great Game.

Beginnings In 1782, George Forster, a civil servant of the East India Company, undertook a journey that began in Calcutta, Bengal and passed through Kashmir, Afghanistan, Herat, Khorassan, Mazanderan, crossed the Caspian Sea by ship, and then travelled to Baku, Astrakhan, Moscow, St Petersburg and then by ship to London. Forster's detailed description of the journey was published in 1798.A Journey from Bengal to England through the Northern part of India, Kashmir, Afghanistan, and Persia, and into Russia by the Caspian Sea by George Forster. Volume 1 1798 and Volume 2 1808 R.Faulding, London.

Rise of Dost Mohammad Khan

After the decline of the Durrani dynasty in 1823, Dost Mohammad Khan established the Barakzai dynasty. Dost Mohammad achieved prominence among his brothers through clever use of the support of his mother's Qizilbash tribesmen and his own youthful apprenticeship under his brother, Fateh Khan. However, in the same year, the Afghans lost their former stronghold of Peshawar to the Sikh Khalsa Army of Ranjit Singh at the Battle of Nowshera. The Afghan forces in the battle were supported by Azim Khan, half-brother of Dost Mohammad.

In 1834 Dost Mohammad defeated an invasion by the former ruler, Shuja Shah Durrani, but his absence from Kabul gave the Sikhs the opportunity to expand westward. Ranjit Singh's forces moved from Peshawar into territory ruled directly by Kabul. In 1836 Dost Mohammad's forces, under the command of his son Akbar Khan, defeated the Sikhs at the Battle of Jamrud, a post fifteen kilometres west of Peshawar. This was a pyrrhic victory and they failed to fully dislodge the Sikhs from Jamrud. The Afghan leader did not follow up this triumph by retaking Peshawar, however, but instead contacted Lord Auckland, the new British governor-general in British India, for help in dealing with the Sikhs. The letter marked the beginning of British influence in Afghanistan, and the subsequent Anglo-Russian struggle known as the Great Game.

The Great Game

During the 19th century, a political and diplomatic confrontation developed between Britain and Russia over Afghanistan which would become known as The Great Game. The British became the major European power in South Asia after the 1763 Treaty of Paris and began to show interest in Afghanistan as early as their 1809 treaty with Shah Shuja Durrani. In the early decades of the 19th century, it became clear to the British that the major threat to their interests in India would not come from the fragmented Afghan empire, the Iranians, or the French, but from the Russians, who had already begun a steady advance southward from the Caucasus winning decisive wars against the Ottomans and Persians. The British viewed Russia's absorption of the Caucasus, the Kyrgyz and Turkmen lands, the Khanate of Khiva, and the Emirate of Bukhara with equal suspicion as a threat to their interests in the Indian subcontinent. The débâcle of the Afghan civil war left a vacuum in the Hindu Kush area that concerned the British, who were well aware of the many times in history it had been employed as an invasion route to South Asia.

At the same time, the Russians feared the possibility a permanent British foothold in Central Asia as the British expanded northward, incorporating the Punjab, Sindh, and Kashmir into their empire. until the mid-19th century, Russian ambassadors to the region spent much of their time trying to free Russians who had been taken as slaves by the khanates. Napoleon had proposed a joint Franco-Russian invasion of India to tsar Paul I of Russia. Expecting a future action by the British against Russia and her allies in Europe, Paul decided in 1801 to make the first move towards where he believed the British Empire was weakest (Indian March of Paul). He wrote to the Ataman of the Don Cossacks Troops, Cavalry General Vasily Petrovich Orlov, directing him to march to Orenburg, conquer the Central Asian Khanates, and from there invade India. Paul was assassinated in the same year, and the invasion was terminated. Russia feared the influence that a Muslim power with British support might have on the other khanates in the region. The Great Game: Britain and Russia in Central Asia. Edited by Martin Ewans. Volume II: Travels in Beloochistan and Sinde, by Henry Pottinger. First published by Longman, London, 1816. This edition by RoutledgeCurzon, Milton Park, England 2004. .

In addition to this rivalry between Britain and Russia, there were two specific reasons for British concern over Russia's intentions. First was the Russian influence at the Iranian court, which prompted the Russians to support Iran in its attempt to take Herat, historically the western gateway to Afghanistan and northern India. In 1837 Iran advanced on Herat with the support and advice of Russian officers. The second immediate reason was the presence in Kabul in 1837 of a Russian agent, Yan Vitkevich, who was ostensibly there, as was the British agent Alexander Burnes, for commercial discussions.

The threat of the expanding Russian Empire beginning to push for an advantage in the Afghanistan region placed pressure on British India, in what became known as the Great Game. The Great Game set in motion the confrontation of the British and Russian empires, whose spheres of influence moved steadily closer to one another until they met in Afghanistan. It also involved repeated attempts by the British to establish a puppet government in Kabul. The remainder of the 19th century saw greater European involvement in Afghanistan and her surrounding territories and heightened conflict among the ambitious local rulers as Afghanistan's fate played out globally.

The British demanded that Dost Mohammad sever all contact with the Iranians and Russians, remove Vitkevich from Kabul, surrender all claims to Peshawar, and respect Peshawar's independence as well as that of Kandahar, which was under the control of his brothers at the time. In return, the British government intimated that it would ask Ranjit Singh to reconcile with the Afghans. When Auckland refused to put the agreement in writing, Dost Mohammad suspended negotiations the British and began negotiations with Vitkevich.

In 1838 Auckland, Ranjit Singh, and Shuja signed an agreement stating that Shuja would regain control of Kabul and Kandahar with the help of the British and Sikhs; he would accept Sikh rule of the former Afghan provinces already controlled by Ranjit Singh, and that Herat would remain independent. In practice, the plan replaced Dost Mohammad with a British figurehead whose autonomy would be similar to the princes who ruled over the princely states in British India.

It soon became apparent to the British that Sikh participation, advancing toward Kabul through the Khyber Pass while Shuja and the British advanced through Kandahar, would not be forthcoming. Auckland's plan in the spring of 1838 was for the Sikhs to place Shuja on the Afghan throne, with British support. By the end of the summer however, the plan had changed; now the British alone would impose the pliant Shuja Shah.

First Anglo-Afghan War, 1838–1842

As a prelude to his invasion plans, the Governor-General of India Lord Auckland issued the Simla Manifesto in October 1838, setting forth the necessary reasons for British intervention in Afghanistan. The manifesto stated that in order to ensure the welfare of India, the British must have a trustworthy ally on India's western frontier. The British claim that their troops were merely supporting Shah Shujah's small army in retaking what was once his throne fooled no one. Although the Simla Manifesto stated that British troops would be withdrawn as soon as Shuja was installed in Kabul, Shuja's rule depended entirely on British support to suppress rebellion and on British funds to buy the support of tribal chiefs. The British denied that they were invading Afghanistan, instead claiming they were supporting its legitimate Shuja government "against foreign interference and factious opposition".

In November 1841 insurrection and massacre flared up in Kabul. The British vacillated and disagreed and were beleaguered in their inadequate cantonments. The British negotiated with the most influential sirdars, cut off as they were by winter and insurgent tribes from any hope of relief. Mohammad Akbar Khan, son of the captive Dost Mohammad, arrived in Kabul and became effective leader of the sirdars. At a conference with them Sir William MacNaghten was killed, but in spite of this, the sirdars' demands were agreed to by the British and they withdrew. During the withdrawal they were attacked by Ghilzai tribesmen and in running battles through the snowbound passes nearly the entire column of 4,500 troops and 12,000 camp followers were killed. Of the British only one, Dr. William Brydon, reached Jalalabad, while a few others were captured.

Afghan forces loyal to Akbar Khan besieged the remaining British contingents at Kandahar, Ghazni and Jalalabad. Ghazni fell, but the other garrisons held out, and with the help of reinforcements from India their besiegers were defeated. While preparations were under way for a renewed advance on Kabul, the new Governor-General Lord Ellenborough ordered British forces to leave Afghanistan after securing the release of the prisoners from Kabul and taking reprisals. The forces from Kandahar and Jalalabad again defeated Akbar Khan, retook and sacked Ghazni and Kabul, rescuing the prisoners before withdrawing through the Khyber Pass.

Mid-nineteenth century

After months of chaos in Kabul, Mohammad Akbar Khan secured local control and in April 1843 his father Dost Mohammad, who had been released by the British, returned to the throne in Afghanistan. In the following decade, Dost Mohammad concentrated his efforts on reconquering Mazari Sharif, Konduz, Badakhshan, and Kandahar. Mohammad Akbar Khan died in 1845. During the Second Anglo-Sikh War (1848–49), Dost Mohammad's last effort to take Peshawar failed.

By 1854 the British wanted to resume relations with Dost Mohammad, whom they had essentially ignored in the intervening twelve years. The 1855 Treaty of Peshawar reopened diplomatic relations, proclaimed respect for each side's territorial integrity, and pledged both sides as friends of each other's friends and enemies of each other's enemies.

In 1857 an addendum to the 1855 treaty permitted a British military mission to become a presence in Kandahar (but not Kabul) during a conflict with the Persians, who had attacked Herat in 1856. During the Indian Rebellion of 1857, some British officials suggested restoring Peshawar to Dost Mohammad, in return for his support against the rebellious sepoys of the Bengal Army, but this view was rejected by British political officers on the North West frontier, who believed that Dost Mohammad would see this as a sign of weakness and turn against the British.*

In 1863 Dost Mohammad retook Herat with British acquiescence. A few months later, he died. Sher Ali Khan, his third son, and proclaimed successor, failed to recapture Kabul from his older brother, Mohammad Afzal (whose troops were led by his son, Abdur Rahman) until 1868, after which Abdur Rahman retreated across the Amu Darya and bided his time.