The borders of the area were not clearly defined until treaties between Spain and France in the early 20th century. Spanish Sahara was then created from the Spanish territories of Río de Oro and Saguia el-Hamra in 1924. It was not part of, and administered separately from, the areas known as Spanish Morocco.
Entering the territory in 1884, Spain was immediately challenged by stiff resistance from the indigenous Sahrawi tribes. A 1904 rebellion led by the powerful Smara-based marabout, shaykh Ma al-Aynayn, was put down by France in 1910, but it was followed by a wave of uprisings under Ma al-Aynayn’s sons, grandsons and other political leaders.
In the 1960s, Morocco continued to claim Spanish Sahara and succeeded in getting it to be listed on the list of territories to be decolonized. In 1969, Spain returned to Morocco the region of Ifni, that served as the seat of the Spanish administration of Spanish Sahara. In 1967, the Spanish colonization was further challenged by a peaceful protest movement, the Harakat Tahrir, which demanded the end of occupation. After its violent suppression in the 1970 Zemla Intifada, Sahrawi nationalism reverted to its militant origins, with the 1973 formation of the Polisario Front. The Front’s guerrilla army grew rapidly, and Spain had lost effective control over most of the countryside in early 1975. An attempt at sapping the strength of Polisario by creating a modern political rival to it, the Partido de Unión Nacional Saharaui (PUNS), met with little success.
Spain proceeded to co-opt tribal leaders by setting up the Djema’a, a political institution (very) loosely based on traditional Sahrawi tribal leaderships. The Djema’a members were hand-picked by the authorities, but given privileges in return for rubber-stamping Madrid’s decisions.
Immediately before the death of the aging Spanish dictator, Francisco Franco, in the winter of 1975, however, Spain was confronted with an intensive campaign of territorial demands from Morocco, and to a lesser extent Mauritania, culminating in the Green March. Spain then withdrew its forces and settlers from the territory, after negotiating a tripartite agreement with Morocco and Mauritania in 1975, by which both took control of the region. Mauritania later surrendered its claim after fighting an unsuccessful war against the Polisario. Morocco engaged in a war with the Algeria-backed Polisario Front, although a cease-fire came into effect in 1991, and the territory remains under dispute.
The United Nations considers the former Spanish Sahara a non-decolonized territory, with Spain as the formal administrative power. UN peace efforts have aimed at the organization of a referendum on independence among the Sahrawi population, but this has not yet taken place. The African Union and at least 44 governments consider the territory a sovereign, albeit occupied, state under the Sahrawi Arab Democratic Republic (SADR), with an exile government backed by the Polisario Front.