The Russians invaded Afghanistan in 1978, but the whole thing was too much for them and they left the country ten-years later in February 1989.
Photos show Soviet troops in Kabul and as they departed the country in February 1989. (Photos from US Dept. for Defence and Novosti).
Soviet Troops in Kabul
Soviets Departing February 1989