The area’s prehistory is relatively unknown. However, finds of rock carvings, graves and implements suggest that hunting and gathering were carried out alternately with livestock management and in some favorable places also agriculture, possibly as early as the 5000s BC.
Through trade, the area was reached early by Islam. Already around 750 AD the Zanata Berber founded the city of Sijilmassa, in two centuries the principal place in a Muslim Karaite kingdom. Another Berber people in the area, Sanhaja, established the Almoravid Empire in the mid-1000s, which for a century dominated western North Africa and the southern part of the Pyrenees peninsula. At the end of the 13th century, an Arab immigration wave reached the country, and unlike other Berbers, the population finally adopted the language of immigrants.
From the beginning of the 1400s, the coastal areas were exposed to European raids, and some slave trade took place. The Sadadic and Alawite dynasties that founded today’s Morocco had links with the peoples of Western Sahara, but attempts to subdue them to control the southern trade routes failed. It was not until the 1880s that some clans chose to submit to the then Sultan of Morocco. At the same time, following agreements with local tribes, the Spanish-African trading company took control of a coastal stretch of 50 miles, which was followed in 1884 by the Spanish colonization of the Río de Oro area and by royal decree in 1887 expansion of control about ten miles into the country. A convention between Spain and France in 1912 established the boundary of the new Spanish colonies Saguia al-Hamra and Río de Oro (collectively called the Spanish Sahara).
The colony, despite the discovery of phosphate deposits in 1947, was pretty much forgotten until 1956, when it was withdrawn into the independence struggle of the surrounding countries. A major French-Spanish military operation took place in 1957–58, when the colony was incorporated in Spain and the Saharan tribal leaders were given seats in the Spanish National Assembly (cortes). To counter neighboring Morocco and Mauritania’s demands in this area, Spain in 1966 recognized the right of future independence for Western Sahara. Under the impression of UN resolutions, the ever-stronger independence movement and General Franco’s illness, Spain withdrew in 1976 after an agreement with Morocco and Mauritania which meant that the area was in practice divided between these two countries. The referendum on the future status of the area, which had been prepared by Spain, was not carried out.Democratic Saharan Arab Republic (RASD) and launched guerrilla war against the Moroccan invasion forces. Large streams of refugees were driven towards southern Algeria, where at least 150,000 people eventually ended up in camps. Only in 1991 was the UN mandated to prepare a referendum, which has not yet been implemented.
The UN is trying to mediate between Polisario’s Algerian-based exile government and Morocco, and has occasionally succeeded in gathering the parties to direct negotiations, but the question has constantly been raised as to who should be eligible to participate in a referendum on the area’s future. Polisario demands that only those who lived in Western Sahara before the Moroccan invasion should be allowed to participate, while Morocco believes that even those Moroccans who have moved to Western Sahara since 1976 should have the right to vote. According to the latest UN plan for resolving the conflict, Western Sahara will be granted limited autonomy in Morocco for a number of years, after which the referendum will take place, but the parties have not been able to agree on the framework for self-government.
The UN Mission MINURSO (UN Mission for the Referendum in Western Sahara), whose 215 military observers (2010) are tasked with monitoring the ceasefire and preparing for the referendum, has each year renewed its mandate for another year by the UN Security Council. No fighting took place in many years, and in 2005 Polisario released the last of about 900 Moroccan prisoners of war, captured during the late 1980s.
Morocco, in 1984, left the then African cooperation organization OAU since it recognized Polisario as the legal government of Western Sahara and granted the country membership. Also, due to the Western Sahara issue, Morocco has not joined the current African Union (AU). A 2005 agreement between Morocco and the EU on European fishing rights in Moroccan waters attracted international criticism as it also included Western Saharan waters. Sweden was the only country that voted against the agreement on the grounds that the area is occupied and that no guarantees were given that Western Saharans would receive a share of the income.