In the waning days of General Franco's rule, and after the Green March, the Spanish government signed a tripartite agreement with Morocco and Mauritania as it moved to transfer the territory on 14 November 1975.
The accords were based on a bipartite administration, and Morocco and Mauritania each moved to annex the territories, with Morocco taking control of the northern two-thirds of Western Sahara as its Southern Provinces, and Mauritania taking control of the southern third as Tiris al-Gharbiyya.
Spain terminated its presence in Spanish Sahara within three months, repatriating Spanish remains from its cemeteries.

The Moroccan and Mauritanian annexations were resisted by the Polisario Front, which had gained backing from Algeria.
It initiated guerrilla warfare and, in 1979, Mauritania withdrew due to pressure from Polisario, including a bombardment of its capital and other economic targets.
Morocco extended its control to the rest of the territory.
It gradually contained the guerrillas by setting up the extensive sand-berm in the desert (known as the Border Wall or Moroccan Wall) to exclude guerrilla fighters.
Hostilities ceased in a 1991 cease-fire, overseen by the peacekeeping mission MINURSO, under the terms of a UN Settlement Plan.
In the waning days of General Franco's rule, and after the Green March, the Spanish government signed a tripartite agreement with Morocco and Mauritania as it moved to transfer the territory on 14 November 1975. The accords were based on a bipartite administration, and Morocco and Mauritania each moved to annex the territories, with Morocco taking control of the northern two-thirds of Western Sahara as its Southern Provinces, and Mauritania taking control of the southern third as Tiris al-Gharbiyya. Spain terminated its presence in Spanish Sahara within three months, repatriating Spanish remains from its cemeteries.
The Moroccan and Mauritanian annexations were resisted by the Polisario Front, which had gained backing from Algeria. It initiated guerrilla warfare and, in 1979, Mauritania withdrew due to pressure from Polisario, including a bombardment of its capital and other economic targets. Morocco extended its control to the rest of the territory. It gradually contained the guerrillas by setting up the extensive sand-berm in the desert (known as the Border Wall or Moroccan Wall) to exclude guerrilla fighters. Hostilities ceased in a 1991 cease-fire, overseen by the peacekeeping mission MINURSO, under the terms of a UN Settlement Plan.
Western Sahara