Algerian President Abdelmadjid Tebbounevisited the Polisario Front leader Brahim Ghali at a military hospital in Algiers, following his return to Algeria after six weeks of medical treatment in Spain.
Tebboune described the visit as "his duty" and reaffirmed his support for Ghali's cause.
The Algerian president also thanked Spain for welcoming Ghali and for the "delicate" care he had received.
Algeria is the main supporter of the Polisario Front, which has for decades fought Morocco for the independence of Western Sahara, a desert region bigger than Britain which was a Spanish colony until 1975.
Considered a war criminal by Morocco, Ghali has headed the Polisario Front since 2016 and is president of the Sahrawi Democratic Arab Republic, a self-declared state in an almost-landlocked area flanking Mauritania's border.
Rabat has offered Western Sahara autonomy but insists that the territory, which is rich in phosphates and offshore fishing, is part of the Moroccan kingdom.