BARCELONA, Spain (AP) — The European Union on Thursday urged Algeria to reverse its decision a day after the gas-rich north African country ordered the suspension of a two-decade-old friendship treaty with Spain.

The move was the latest by Algeria to ratchet up pressure on Madrid after Spain’s government changed is long-standing policy regarding the contested territory of Western Sahara, whose independence movement from Morocco is supported by rival Algeria.

Algeria recalled its ambassador to Spain in March after Madrid came out in support of Morocco’s pretensions to keep Western Sahara under its rule.

Spain was the former colonial power in Western Sahara until it was annexed by Morocco in 1975. Since then, Algeria and neighboring Morocco have had tense ties over the fate of the Western Sahara, at one point fighting a desert war.

Algeria’s now openly hostile turn against a member of the 27-country EU bloc comes while Spain and the rest of the continent is hustling to find alternatives to Russian energy imports in retaliation to its invasion of Ukraine.

European Commission spokeswoman Nabila Massrali told reporters Thursday that the decision is “deeply worrying, and we therefore call on the Algerian authorities to review their decision.

“Algeria is an important European Union partner in the Mediterranean (region), and a key actor for regional stability,” Massrali said. “We are evaluating the impact of the decision, and solutions must be found through dialogue and diplomatic means.

“We hope that Algeria will reverse its decision and work with Spain to overcome the current disagreement.”

The true impact of the diplomatic move is yet to be seen, although Algeria has reportedly ordered its national bank to stop facilitating payments with Spain, which could disrupt trade.

The Spanish government quickly moved to assuage fears that Algeria’s important supply of natural gas that it pumps and ships across the Mediterranean could be at risk.

Spanish Foreign Minister José Albares said that so far no Spanish companies working with Algeria have reported any “inconveniences.”

And, he added, “what the gas companies are telling us is that the decision has not caused any difficulties.”

Algeria’s Sonatrach was Spain’s leading supplier of natural gas last year with more than 40% of its imports. Coinciding with the fraying of relations with Algeria, Spain has since pivoted to the United States, which has become its leading supplier of gas in recent months ahead of Algeria.

Algeria, whose fragile economy depends heavily on its energy exports, signed a new deal with Italy in April to increase the gas flow through the pipeline connecting the two countries.

Spain imports large amounts of fertilizers in addition to gas from Algeria, while Spanish companies send primarily soy oil and meat products the other way.

While thousands of migrants from Africa leave from the coasts of Morocco for Spain each year, Algeria also plays an important role in controlling unauthorized migration from its coasts.

Spain, Morocco and Algeria have been caught in a three-way diplomatic tug-of-war over Western Sahara for the past year.

Trouble started when Spain allowed the leader of Western Sahara’s separatist movement enter Spain to receive treatment for COVID-19 in May 2020. Morocco responded by dropping its border controls around the Spain’s north Africa enclave of Ceuta, which was quickly overwhelmed by thousands of migrants including many young Moroccans.

Relations only normalized between Madrid and Rabat after Spanish Prime Minister Pedro Sánchez took the unpopular decision at home to back Morocco’s plan to keep Western Sahara under its control as an autonomous area.

But that, in turn, has pushed Algiers away.

The crisis with Algeria comes with Sánchez’s government facing intense criticism at home for its siding with Morocco and with Spain’s economy struggling with high energy prices driven by global inflation.

___

Lorne Cook in Brussels, and Ciarán Giles in Madrid, contributed to this report.