Algeria has summoned its ambassador to Spain back for consultations over Madrid's recent comments on Western Sahara, the foreign affairs ministry said on Saturday.
"The Algerian authorities were very surprised by the surprising statements of the highest authorities in Spain on the issue of Western Sahara," it said.
Spain said on Saturday the government had informed Algeria about its position "in relation to Western Sahara", a government source told Reuters.
"For Spain, Algeria is a strategic, priority and reliable partner with whom we intend to maintain a privileged relationship," the source added.
Algeria is a key gas supplier to Spain and Italy.
Spain and Morocco moved to patch up a diplomatic dispute on Friday as Madrid shifted closer towards Rabat's position on the conflict in Western Sahara and said "a new phase in relations" had begun.
Spain appeared to shift its policy on the Western Sahara which Morocco considers its own, but where an Algeria-backed independence movement demands a sovereign state.
Morocco said it had a letter saying Spain considered the autonomy initiative it presented in 2007, as "the most serious, realistic and credible basis for selling the dispute".
Spain's new position towards the Western Sahara is an "unexpected" shift from its previous neutral stance, which was supportive of a United Nations plan that includes a self-determination referendum, an Algerian diplomatic source told Reuters.
"This is a betrayal of the Sahrawi people," the Algerian source added.