Here are key dates in the history of the Western Sahara, as the United Nations prepares to convene talks in Geneva on the disputed territory's future status on Wednesday.
The former Spanish colony is mainly controlled by Morocco but has been contested for decades by the pro-independence Polisario Front.
On October 16, 1975 the International Court of Justice in The Hague recognises the existence of colonial-era links between the Western Sahara and neighbouring Morocco and Mauritania.
However, it rules them insufficient to support ownership and rules in favour of self-determination for the territory.
On November 6, about 350 000 Moroccans respond to calls from King Hassan II to take part in a Green March to the border to assert the kingdom's claim.
A deal is signed on November 14 in Madrid ending Spanish control. The northern and central sections of the territory are handed to Morocco and the southern part goes to Mauritania.
On February 27, 1976, the Polisario, founded in 1973, declares Western Sahara the Sahrawi Arab Democratic Republic (SADR) with support from Algeria and Libya.
On August 5, 1979, Mauritania signs a peace deal with the Polisario ceding the southern part of the territory in a move not recognised by Morocco.
Rabat deploys more troops and from 1980 the war shifts in its favour as it builds a series of heavily fortified walls in the desert to keep Polisario fighters out of territory where it has established control.
On November 12, 1984, Morocco walks out of the Organisation of African Unity after the bloc admits the SADR as a member.
Ceasefire but no settlement
On September 6, 1991, a ceasefire comes into force ending 16 years of war under the watch of UN peacekeeping mission Minurso, which is charged with organising a referendum on self-determination.
In 1992, a planned vote is aborted when Morocco challenges the electoral register drawn up by Minurso.
In 2002, Morocco's King Mohammed VI says a self-determination vote is "obsolete" and "inapplicable".
The UN tries to resurrect the issue in July 2003, drawing on a plan by former US secretary of state James Baker that envisages a self-determination referendum after five years of autonomy.
Accepted by Algeria and the Polisario, it is rejected by Rabat which says it is prepared to consider autonomy for the territory but within the framework of "non-negotiable" Moroccan sovereignty.
On April 11, 2007, Rabat presents an autonomy plan to the UN. It is rejected by the Polisario, which reiterates the right of the Sahrawi people to self-determination.
UN under pressure
On March 8, 2016, the Moroccan government reacts with fury when UN secretary general Ban Ki-moon uses the term "occupation" to refer to the status of Western Sahara during a visit to a Sahrawi refugee camp in neighbouring Algeria.
On March 13, hundreds of thousands of Moroccans rally in Rabat to protest what they call the UN chief's "lack of neutrality".
On September 23, Morocco makes an official request to rejoin the African Union, 32 years after it quit in protest.
On March 6, 2017, the UN envoy for Western Sahara, veteran American diplomat Christopher Ross, resigns after an eight-year stint during which Rabat accused him of bias.
Former German president Horst Koehler is named the new envoy on August 16. He tours the region in October with the aim of restarting peace talks.
He makes a second visit in June 2018 and in September invites the two sides along with Algeria and Mauritania to Geneva for talks on December 5-6.