Algeria withdrew its ambassador from France on Tuesday in response to France's recognition of Moroccan sovereignty in the Western Sahara region.
Algeria took similar measures against Madrid when Spain backed Morocco's autonomy plan in 2022.
France made its decision as it believes Moroccan sovereignty as the only way of resolving a long-running dispute over the territory, President Emmanuel Macron said in a letter Tuesday.
The dispute, dating back to 1975, pits Morocco, which considers Western Sahara its own territory, against the Algeria-backed Polisario Front, which seeks an independent state there.
France, as the former colonial power in the region, has walked a diplomatic tightrope between Rabat and Algiers on the issue. Most of France's Western allies have already backed Morocco's plan.
"For France, autonomy under Moroccan sovereignty is the framework within which this issue must be resolved," according to the letter sent by Macron to Morocco's King Mohammed VI.
"Our support for the autonomy plan proposed by Morocco in 2007 is clear and constant. For France, it now constitutes the only basis for achieving a just, lasting and negotiated political solution in line with the resolutions of the United Nations Security Council."
Macron said Paris views Western Sahara as part of Morocco's present and future sovereignty, adding that France would act according to this position domestically and internationally.
The Royal Palace in a statement welcomed the announcement as a "significant development in support of Moroccan sovereignty over the Sahara."
Algeria expressed "great regret" and strongly denounced Paris' decision, adding there would be consequences.
Algeria has recognized the Polisario's self-proclaimed Sahrawi republic and backed a United Nations plan for a referendum with independence as an option.
That referendum never took place due to disagreements over who should vote and how it should be conducted and recent U.N. Security Council resolutions have not mentioned the option, urging the parties to work together for a realistic solution based on compromise.
Spain, the former colonial power in Western Sahara, said in 2022 it backs Morocco's autonomy plan.
The U.S., Israel and Arab monarchies also back Morocco's sovereignty over the territory, where 28 mostly African and Arab countries have opened consulates in what Rabat sees as tangible support.
The Polisario in 2020 withdrew from a U.N.-brokered truce. But the long-frozen conflict remains of low intensity.