The war in Afghanistan became a quagmire for what by the late 1980s was a disintegrating Soviet Union. (The Soviets suffered some 15,000 dead and many more injured.) In 1988 the United States, Pakistan, Afghanistan, and the Soviet Union signed an agreement by which the latter would withdraw its troops (completed in 1989), and Afghanistan returned to nonaligned status. In April 1992 various rebel groups, together with newly rebellious government troops, stormed the besieged capital of Kabul and overthrew the communist president, Najibullah, who had succeeded Karmal in 1986.