Under the Geneva Accords on 15 April 1988, Afghanistan and Pakistan signed three instruments-on principles of mutual relations, in particular non-interference and non-intervention, on the voluntary return of Afghan refugees, and on interrelationships for the settlement, which provided for phased withdrawal of foreign soldiers to begin on 15 May. The United States and the USSR also signed a declaration on international guarantees, stating they would both refrain from any form of interference and intervention.
In the first three-month period, it was reported that some 50,183 foreign soldiers had withdrawn. Another 50,100 left between 15 August 1988 and 15 February 1989.
The whole time, during the withdrawal over the border, troop convoys were coming under attack by Afghan fighters. In all 523 Soviet soldiers were killed during the withdrawal.
The total withdrawal of all Soviet soldiers from Afghanistan was completed on 15 February 1989, in compliance with the terms of the Geneva Accords signed 10 months earlier.
In a symbolic move, Lt. Gen. Boris Gromov was the last to walk from Afghanistan back into Soviet territory.