France's President Emmanuel Macron has told Morocco's parliament that he believes Western Sahara should be under Moroccan sovereignty, and has pledged to invest French money there.
Western Sahara is a territory on the north-western coast of Africa that has been the subject of a decades-long dispute.
It was once a Spanish colony, and is now mostly controlled by Morocco and partly by the Algerian-backed Polisario Front - which says it represents the indigenous Sahrawi people and wants an independent state.
France was the former colonial power in both Morocco and Algeria. It joins other nations including Spain, the US and Israel in backing Morocco's plan.
Lawmakers rose to their feet and applauded Macron on Tuesday when he said, "for France, this territory's present and future fall under Morocco's sovereignty".
His comments on Tuesday in Rabat echo surprise remarks he first made in July.
Signalling a change in France's long-held stance on Morocco's plan to grant Western Sahara autonomy under Moroccan sovereignty, the French president said it was the "only basis" for a just and lasting political settlement.
France's backing of Morocco's territorial claim angered Algeria, which responded to the news by withdrawing its ambassador to Paris.
Algiers regards Morocco's presence there as an illegal occupation.
Analysts say France's decision to back Morocco's claim is an attempt to repair relations between the two nations, which had soured after Rabat was accused of attempting to spy on President Macron and France tightened visa restrictions for visiting Moroccan nationals.
Relations between Morocco and Algeria have become especially tense in recent years, with Algiers announcing in 2021 that it had severed diplomatic ties with its neighbour to the west.
On Tuesday, Macron also addressed colonialism but stopped short of an apology.
"Our common history also has dark parts. The time came for unequal treaties, when hubris and the mechanical force of European countries imposed themselves around the world, and when, even disguised as a protectorate, Morocco did not escape the ambitions and the violence of colonial history," he said.
In a sign of closening ties, France and Morocco are reported to have struck deals on energy and infrastructure among other things.
The AFP news agency says they have a total value of "up to €10bn", equivalent to $10.8bn or £8.3bn.
On Tuesday, Macron also pledged an unspecified sum of "investments and sustainable support initiatives to benefit local populations" in Western Sahara.
'Significant' development
Macron's invitation to Morocco came from King Mohammed VI, two months after his royal court hailed France's change of heart on Western Sahara as a "significant" development.
But Algeria has expressed its deep disapproval, saying France is denying Sahrawi people their right to self-determination.
The Polisario Front, meanwhile, has hit out at France for supporting what it says is a "violent and illegal occupation" by Morocco.
Western Sahara was annexed by Morocco in 1975.
A 16-year-long insurgency ended with a UN-brokered truce in 1991 and the promise of a referendum on independence, which has yet to take place because of disagreements over how it should be conducted and who should be eligible to take part.
Today, the African Union is the only international organisation to recognise Western Sahara as a state in its own right.