Treaty of Gandamak

Mohammad Yaqub Khan of Afghanistan (in the middle) with Sir Louis Cavagnari (second from left), military administrator of the British Government of India, on 26 May 1879.

The Treaty of Gandamak (Dari: معاهده گندمک, Pashto: د گندمک تړون) officially ended the first phase of the Second Anglo-Afghan War. The Afghan emir Mohammad Yaqub Khan ceded various frontier areas as well as Afghanistan's control of its foreign affairs to the British Raj.

It was signed on 26 May 1879 by King Mohammad Yaqub Khan of Afghanistan and Sir Louis Cavagnari of the British Government of India at a British army camp near the village of Gandamak, about 70 miles (110 km) east of Kabul. The treaty was ratified by Lord Edward Robert Bulwer-Lytton, Viceroy of India, on 30 May 1879.

Most historical writings consider the Treaty of Gandamak as the prelude to the second phase of the Second Anglo-Afghan War, 1879–1880. As result of the British victory at the Battle of Kandahar in 1880 the treaty was reaffirmed and the British appointed Abdur Rahman, a British opponent, as Emir of Afghanistan. Later during Abdur Rahman's reign, he constantly opposed the British and forced them to concede and support him in his foreign policy and internal rule.