The Soviet Union invaded Afghanistan to help the Communist government defeat guerrilla Muslim troops. Communist governments controlled Afghanistan and the former Soviet Union in the late 1970s. The Soviet Union supported and encouraged the practice of communism in other governments, and it lent a helping hand to nearby Afghanistan to quell anti-Communist actions.
Although the Soviet Union did not arrive to help communist Afghan troops until December 24, 1979, troubles began much earlier in Afghanistan. In 1978, Nur Mohammad Taraki led Communist supporters in an attack on the centrist government. Taraki successfully overthrew the dominant government that was headed by President Mohammad Daud Khan. Taraki's party proved powerful, but it sparked resentment and outrage among Afghan citizens. The primarily Muslim Afghan citizen body disapproved of the Communist practices and policies supported by Taraki.
While Taraki's support from citizens waned, support from the Soviet Union increased. The Soviet Union sent in troops to help the Communist government control skirmishes and backlashes launched by opposing militant groups. In the midst of internal strife, Taraki lost control of the government. The Soviet Union replaced him with Babrak Karmal, a fellow Communist supporter. As with Taraki, Afghan citizens opposed the leadership of Karmal. Other nations, including the United States, jumped in to support anti-Communist troops. In 1988, the Soviet Union withdrew its troops after signing a treaty with the United States, Afghanistan and Pakistan.