While initial Spanish interest in the Sahara was focused on using it as a port for the slave trade, by the 1700s Spain had transitioned economic activity on the Saharan coast towards commercial fishing.
After an agreement among the European colonial powers at the Berlin Conference in 1884 on the division of spheres of influence in Africa, Spain seized control of Western Sahara and established it as a Spanish colony.
After 1939 and the outbreak of World War II, this area was administered by Spanish Morocco.
As a consequence, Ahmed Belbachir Haskouri, the Chief of Cabinet, General Secretary of the Government of Spanish Morocco, cooperated with the Spanish to select governors in that area.
The Saharan lords who were already in prominent positions, such as the members of Maa El Ainain family, provided a recommended list of candidates for new governors.
Together with the Spanish High Commissioner, Belbachir selected from this list.
During the annual celebration of Muhammad's birthday, these lords paid their respects to the caliph to show loyalty to the Moroccan monarchy.

As time went by, Spanish colonial rule began to unravel with the general wave of decolonization after World War II; former North African and sub-Saharan African possessions and protectorates gained independence from European powers.
Spanish decolonization proceeded more slowly, but internal political and social pressures for it in mainland Spain built up towards the end of Francisco Franco's rule.
There was a global trend towards complete decolonization.
Spain began rapidly to divest itself of most of its remaining colonial possessions.
By 1974–75 the government issued promises of a referendum on independence in Western Sahara.

At the same time, Morocco and Mauritania, which had historical and competing claims of sovereignty over the territory, argued that it had been artificially separated from their territories by the European colonial powers.
Algeria, which also bordered the territory, viewed their demands with suspicion, as Morocco also claimed the Algerian provinces of Tindouf and Béchar.
After arguing for a process of decolonization to be guided by the United Nations, the Algerian government under Houari Boumédiènne in 1975 committed to assisting the Polisario Front, which opposed both Moroccan and Mauritanian claims and demanded full independence of Western Sahara.

The UN attempted to settle these disputes through a visiting mission in late 1975, as well as a verdict from the International Court of Justice (ICJ).
It acknowledged that Western Sahara had historical links with Morocco and Mauritania, but not sufficient to prove the sovereignty of either State over the territory at the time of the Spanish colonization.
The population of the territory thus possessed the right of self-determination.
On 6 November 1975 Morocco initiated the Green March into Western Sahara; 350,000 unarmed Moroccans converged on the city of Tarfaya in southern Morocco and waited for a signal from King Hassan II of Morocco to cross the border in a peaceful march.
A few days before, on 31 October, Moroccan troops invaded Western Sahara from the north.
While initial Spanish interest in the Sahara was focused on using it as a port for the slave trade, by the 1700s Spain had transitioned economic activity on the Saharan coast towards commercial fishing. After an agreement among the European colonial powers at the Berlin Conference in 1884 on the division of spheres of influence in Africa, Spain seized control of Western Sahara and established it as a Spanish colony. After 1939 and the outbreak of World War II, this area was administered by Spanish Morocco. As a consequence, Ahmed Belbachir Haskouri, the Chief of Cabinet, General Secretary of the Government of Spanish Morocco, cooperated with the Spanish to select governors in that area. The Saharan lords who were already in prominent positions, such as the members of Maa El Ainain family, provided a recommended list of candidates for new governors. Together with the Spanish High Commissioner, Belbachir selected from this list. During the annual celebration of Muhammad's birthday, these lords paid their respects to the caliph to show loyalty to the Moroccan monarchy.
As time went by, Spanish colonial rule began to unravel with the general wave of decolonization after World War II; former North African and sub-Saharan African possessions and protectorates gained independence from European powers. Spanish decolonization proceeded more slowly, but internal political and social pressures for it in mainland Spain built up towards the end of Francisco Franco's rule. There was a global trend towards complete decolonization. Spain began rapidly to divest itself of most of its remaining colonial possessions. By 1974–75 the government issued promises of a referendum on independence in Western Sahara.
At the same time, Morocco and Mauritania, which had historical and competing claims of sovereignty over the territory, argued that it had been artificially separated from their territories by the European colonial powers. Algeria, which also bordered the territory, viewed their demands with suspicion, as Morocco also claimed the Algerian provinces of Tindouf and Béchar. After arguing for a process of decolonization to be guided by the United Nations, the Algerian government under Houari Boumédiènne in 1975 committed to assisting the Polisario Front, which opposed both Moroccan and Mauritanian claims and demanded full independence of Western Sahara.
The UN attempted to settle these disputes through a visiting mission in late 1975, as well as a verdict from the International Court of Justice (ICJ). It acknowledged that Western Sahara had historical links with Morocco and Mauritania, but not sufficient to prove the sovereignty of either State over the territory at the time of the Spanish colonization. The population of the territory thus possessed the right of self-determination. On 6 November 1975 Morocco initiated the Green March into Western Sahara; 350,000 unarmed Moroccans converged on the city of Tarfaya in southern Morocco and waited for a signal from King Hassan II of Morocco to cross the border in a peaceful march. A few days before, on 31 October, Moroccan troops invaded Western Sahara from the north.
Western Sahara