In 1979, Mauritania withdrew from the conflict and territories, leading to a stalemate through most of the 1980s. After several more engagements between 1989 and 1991, a cease-fire agreement was reached between the Polisario Front and the Moroccan government. At the time, most of the Western Sahara territory remained under Moroccan control, while the Polisario controlled some 20% of the territory in its capacity as the Sahrawi Arab Democratic Republic, with additional pockets of control in the Sahrawi refugee camps along the Algerian border.