Sunday’s appointment of Morocco’s ambassador to Spain ended a 10-month-old row between these two Mediterranean neighbors. Madrid had changed its position on Western Sahara (an ex-colony in North Africa), and Morocco was unable to reinstate its ambassador.

The move opened up a new diplomatic front to Spain with Algeria, its other North Africa neighbour and a key natural gas supplier. In protest of Spain’s “U turn”, Madrid recalled its ambassador.

The dispute over Western Sahara is between Morocco, which annexed the vast territory in 1976 and the Algeria-backed Polisario Front independence group.

Karima Benyaich was the Moroccan envoy to Spain. She told EFE, the Spanish state news agency, that she had just returned from Madrid, the day after Rabat supported her plan to give Western Sahara more autonomy.

Pedro Sanchez, the Spanish Prime Minister, wrote to Mohammed VI of Morocco calling Rabat’s proposal “the most serious and realistic” approach for resolving the dispute over decades.

However, the Polisario has criticised Spain’s shift in stance. The independence-seeking Sahrawis claim that the decision is a “grave mistake” that allows Morocco to control the flow of migrants into Europe.

They accuse Madrid also of being a party to a dispute that, for decades, the Spanish government claimed could only be resolved in a referendum under the United Nations.

EFE quoted Benyaich as saying, “It’s a pleasure returning to Madrid and strengthening the relations between Spain & Morocco in the manner that our respective countries have determined.”

Algeria, which has supported the Polisario, recalls its ambassador to Spain, condemning Madrid’s “abrupt Uturn” in a statement.

Officials from the Spanish Foreign Ministry stated that Madrid had previously informed the Algerian government of its position on Sahara.

The official who could not be identified in media reports said that Algeria was a strategic partner for Spain and a priority partner.