ALGIERS, Algeria (AP) — The Algerian president’s office announced Wednesday that the North African nation was “immediately” suspending a two-decades-old friendship treaty with Spain.

It was the latest blow to increasingly wobbly relations between Algiers and Madrid — which depends on Algeria for its natural gas supply.

Tensions have soared in a complex three-way dispute after Spain apparently gave its backing to Morocco’s position over the disputed Western Sahara territory. Algeria backs the Polisario independence movement in the region, which rejects Morocco’s annexation of Western Sahara. The Polisario are encamped in southern Algeria.

The statement from Algerian President Abdelmadjid Tebboune’s office cited what it said was the “unjustifiable turnaround” in March on Spain’s position, amounting to a “fait accompli using fallacious arguments.” It said that Spain has since campaigned “to justify” its position.

The statement said Spain was abusing its role as an “administrating power” in the Western Sahara until the United Nations sorts out the decades-old situation over the status of the vast, mineral-rich territory. It is, therefore, “contributing directly to the degradation of the situation in the Western Sahara and the region,” the Algerian president’s office said.

“In consequence, Algeria has decided to proceed immediately with the suspension” of the treaty, which has served as the framework in the two countries’ ties, the statement said. The treaty dates to 2002.

Spain’s government said it regretted Algeria’s decision and reaffirmed its commitment to the friendship treaty.

“The Spanish government regards Algeria as a friendly neighbor country and restates its complete readiness to keep and develop the special cooperation relationship between our two countries, to the benefit of the people of both,” a Spanish Foreign Ministry statement said.

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. Morocco wants some autonomy for the region with Moroccan oversight over what it calls its “southern provinces.”

The two African countries broke diplomatic relations in August in the standoff.

The Western Sahara issue has combined with turbulence over energy supplies from gas-rich Algeria. The Algerian press regularly refers to Spain’s backing for Morocco as a form of “treason.”

In 2021, Algeria’s Sonatrach furnished Spain with more than 40% of its imported natural gas, most brought in via the underwater Medgaz pipeline. Another supply route to Spain was via the Maghreb Europe pipeline that passes through Morocco but that was shut off after the August break in diplomatic ties between Algeria and Morocco.