According to a report British concern that soviet Russia might mount an offensive against British India via Afghanistan resulted in the Anglo-Afghan wars beginning 1839. The treaty of Gandamak, 1879 was reportedly signed during the second Afghan war. Resulted in territories, now part of Pakistan being taken over by the British Raj. Reportedly as part of the agreement Afghanistan was to conduct foreign relations according to British advice and wishes. The treaty which resulted in more fighting was followed by the Durand line, an agreement said to be between British India and Afghanistan which ceded part of Pashtun territory to British rule. Reportedly the Durand line was recognised by Afghan president Mohammed Khan in 1976. According to reports he was killed in the presidential palace along with other family members in 1978 by military officers from Afghanistan’s communist party. Lead to ten years of conflict with soviet Russia who were said to have intervened on behalf of the new government and fought with the mujahideen in Afghanistan.
Reportedly many of the Afghan mujahideen were from Peshaware now Pakistan, possibly of Pashtun heritage. Others were said to be of an Iranian cultural group. Said to be formed as a political group with a communitarian ideology based on Islamic law at Kabul university, they reportedly became the taliban.