Algeria's banking association halted trade with Spain as of Thursday, after the Spanish government sided with Morocco in a dispute over Western Sahara.
Banking transfers for imports from or exports to Spain are now prohibited. However, natural gas imports will not be affected, Algerian President Abdelmadjid Tebboune said in a statement.
Algeria is the most important exporter of natural gas to Spain.
Spain had agreed in March that Western Sahara can be an autonomous province under Moroccan sovereignty, as desired by Morocco. Madrid also announced shortly afterwards that relations with Morocco were entering a "new phase," building on mutual respect and securing the stability and territorial integrity of both countries.
Western Sahara was a Spanish colony until 1975. When Spain pulled out, Morocco annexed part of the territory, and has since controlled significant areas of the region, which is sparsely populated but rich in natural resources.
However, the Frente Polisario movement, supported by Algeria, is in favour of establishing Western Sahara as an independent state. The movement frequently clashes with Moroccan troops.
Morocco's sovereignty over the area has not been internationally acknowledged.
Spain's decision also prompted Algeria to suspend a 20-year-old friendship agreement.
The Algerian presidential office said that Spain's decision was contributing to the deterioration of the situation in Western Sahara and the region as a whole.