The war was split into two campaigns - the first began in November 1878 with the British invasion of Afghanistan. The British were quickly victorious and forced the Amir - Sher Ali Khan to flee. Ali's successor Mohammad Yaqub Khan immediately sued for peace and the Treaty of Gandamak was then signed on 26 May 1879. The British sent an envoy and mission led by Sir Louis Cavagnari to Kabul but on 3 September this mission was massacred and the conflict was reignited by Ayub Khan which led to the abdication of Yaqub.