Algeria, Spains biggest natural-gas supplier, recalled its ambassador to Madrid for consultations after the Spanish government took Moroccos side in a North African territorial dispute.

The friction over the status of Western Sahara could spell trouble for Spain at a time when countries across Europe are seeking alternate sources of gas after Russias invasion of Ukraine. Spain signaled on Friday that it backs Moroccan plans to grant limited autonomy to the territory, which has been a historic source of tension with Algeria. 

The decision follows the sudden reversal of Spains position on Western Sahara, Algerias APS news agency reported Saturday, citing a Foreign Ministry statement. Spains shift abandoned its policy of neutrality toward the territory, which it once ruled.


Read more: Spain to Mend Ties With Morocco After Western Sahara U-Turn

Spain for years received Algerian gas through two pipelines, one directly from Algeria and another through Morocco. Algeria

stopped pumping gas through the Moroccan pipeline last year, prompting Spain to import more gas by ship, which is costlier. 

Algeria and Morocco cut diplomatic ties last year, while Spain and Morocco have previously clashed over immigration from North Africa to Spains southern coast.

The Spanish government had previously informed Algeria about its position regarding Sahara, the Spanish government said in a statement on Saturday. For Spain, Algeria is a strategic, priority and loyal partner.