A war ensued with the Algerian-backed armed Polisario Front independence movement, which contested Rabat's sovereignty, ending only in 1991 with a UN-brokered ceasefire.