From Wikipedia
The best-known mujahideen, various loosely-aligned Afghan opposition groups, initially fought against the incumbent pro-Soviet Afghan government during the late 1970s. At the Afghan government's request, the Soviet Union became involved in the war. The mujahideen insurgency then fought against the Soviet and Afghan government troops during the Soviet war in Afghanistan. After the Soviet Union pulled out of the conflict in the late 1980s the mujahideen fought each other in the subsequent Afghan Civil War.