Algeria on Wednesday said it rejects the coup in neighbouring Mali and called for elections in line with its constitution.
"Algeria reiterates its firm rejection of any anti-constitutional change of government," the foreign ministry said in a statement received by AFP.
It said Algeria was following with "concern" developments in Mali, with which it shares an almost 1,400-kilometre-long (850 miles) border.
Algiers called on "all parties to respect constitutional order and to return to reason for a rapid end to the crisis", the ministry said.
"Only polls constitute the path to power and legitimacy," it added.
Algeria in 2015 hosted negotiations between Mali's government and rebel movements that led to a ceasefire accord.
On Tuesday, rebel soldiers took President Ibrahim Boubacar Keita and Prime Minister Boubou Cisse into custody and drove them to a military base on the outskirts of Bamako.
Keita, embattled by months of protests over economic stagnation, corruption and a brutal Islamist insurgency, later said he had resigned to avoid bloodshed.
The coup leaders appeared on television overnight to pledge a political transition and new elections within a "reasonable time".
Both the European Union and African Union, however, called Wednesday for the immediate release of the prisoners.
The EU has operated a mission training the armed forces in Mali since 2013 and in July announced a joint EU special ops force to back Mali's fight against jihadist groups.