There is evidence of trade between the Western Sahara and Europe by the 4th cent. B.C. Portuguese navigators reached Cape Bojador on the northern coast of present-day Western Sahara in 1434. However, there was little European contact with the region until the 19th cent. In 1884, Spain claimed a protectorate over the coast from Cape Bojador to Cap Blanc (at the present border with Mauritania). The boundaries of the protectorate were extended by Franco-Spanish agreements in 1900, 1904, and 1920. Essemara was not captured until 1934, and the Spanish had only slight contact with the interior until the 1950s. In 1957, a rebel movement ousted the Spanish, who regained control of the region with French help in Feb., 1958.
In Apr., 1958, Spain joined the previously separate districts of Saguia el Hamra (in the north) and Río de Oro (in the south) to form the province of Spanish Sahara. In the early 1970s, dissidents formed organizations seeking independence for the province. At the same time, neighboring nations (notably Mauritania, Morocco, and Algeria) pressured Spain to call a referendum on the area's future in accordance with UN resolutions. Continuing guerrilla warfare in the 1970s, and a march of over 300,000 Moroccans into the territory in 1975, led to Spain's withdrawal from the province in 1976, when it was renamed Western Sahara.
Upon Spain's withdrawal, Morocco and Mauritania subdivided the region, with Morocco controlling the northern two thirds and Mauritania the southern third. A nationalist group, the Polisario Front, waged guerrilla warfare against the two nations with support from Algeria, calling the territory the Sahrawi Arab Democratic Republic. In 1979, Mauritania withdrew from its portion, which was absorbed by Morocco. Polisario continued its attacks on Moroccan strongholds; the protracted warfare caused thousands of refugees to flee into neighboring Algeria, and eventually Morocco built a defensive wall around the area.
A UN-monitored cease-fire was implemented in 1991, and a referendum was to decide the territory's future. Disputes regarding who would be permitted to vote delayed the referendum in the following years, during which time the region was integrated administratively into Morocco. UN attempts to broker a peace agreement have been unsuccessful, with Morocco, which has spent significant sums on development since the 1990s, generally rejecting any plan that might end its sovereignty over the area. Beginning in 2007 both sides participated in UN-sponsored talks, but the intermittent negotiations produced no breakthrough. In Nov., 2010, violent clashes between Sahrawis and security forces broke out after government forces moved to clear a Sahrawi protest encampment outside Laayoune.