Two Algerian diplomats kidnapped in Mali in April 2012 by the Movement for Oneness and Jihad in West Africa (MUJAO) were freed on Saturday, the Algerian foreign ministry announced.
A third diplomat still held hostage, consul Boualem Sayes, had died "from a chronic illness", the ministry said.
It did not say whether Mourad Guessas and Kedour Miloudi had been released by their kidnappers or had been freed in a military operation.
The ministry also confirmed for the first time the execution, reported in September 2012, of vice-consul Tahar Touati, describing his death as an "odious assassination".
Algeria's consul in Gao, in northeastern Mali, and six of his staff were taken hostage by MUJAO on April 5, 2012 while the Islamist militants were in control of the city.
Three jihadist groups, Al-Qaeda in the Islamic Maghreb (AQIM), Ansar Dine and MUJAO, in 2012 took control of much of the desert north of Mali, including the three main towns of Kidal, Gao and Timbuktu.
French troops later expelled them.