During the last few years of the Soviet–Afghan War, Varennikov was the personal representative in Kabul of the Soviet Defence Minister and held negotiations with the United Nations Good Offices Mission in Afghanistan and Pakistan members who oversaw the pullout from the country of Soviet troops between 1988 and 1989. Varennikov continued to defend the war even after the Soviet withdrawal in 1989.