Mali President Ibrahim Boubacar Keita resigned on Tuesday and dissolved parliament hours after mutinying soldiers detained him at gunpoint, plunging a country already facing a jihadist insurgency and mass protests deeper into crisis.
Looking tired and wearing a surgical mask, Keita resigned in a brief address broadcast on state television after troops seized him along with Prime Minister Boubou Cisse and other top officials.
"If today, certain elements of our armed forces want this to end through their intervention, do I really have a choice?" he said from a military base in Kati outside the capital Bamako where he had been detained earlier in the day.
It was not immediately clear who was leading the revolt, who would govern in Keita's absence or what the mutineers wanted.
Images posted earlier on social media said to be taken at the Kati garrison showed Keita and Cisse surrounded by armed soldiers. Reuters could not verify the authenticity of the videos.
Mali has seen months of protests against alleged corruption and worsening security in the West African country where Islamist militants are active, and there have been calls for Keita to resign.
The M5-RFP coalition behind the protests signalled support for the mutineers' action, with spokesman Nouhoum Togo telling Reuters it was "not a military coup but a popular insurrection".
Hundreds of anti-government protesters poured into a central square in Bamako to celebrate and cheer the mutineers as they drove through in military vehicles and fired rounds of celebratory gunfire.
A mutiny in 2012 at the same Kati base led to a military coup that toppled then-President Amadou Toumani Toure and hastened the fall of Mali's north to jihadist militants.
French forces intervened the following year to beat them back. But the militants have since regrouped and expanded their influence into neighbouring Burkina Faso and Niger, attacking soldiers, civilians and Western tourists.
France and other international powers as well as the African Union denounced the mutiny, fearful that Keita's fall could further destabilise the former French colony and West Africa's entire Sahel region.
UN Secretary-General Antonio Guterres called for the immediate release of Keita and the other detainees.
"I energetically condemn the arrest of President Ibrahim Boubacar Keita, the prime minister and other members of the Malian government and call for their immediate liberation," African Union Chairman Moussa Faki Mahamat said on Twitter.
French Foreign Minister Jean-Yves Le Drian said France "condemns in the strongest terms this grave event".
The US envoy to the Sahel, J. Peter Pham, said on Twitter that "the US is opposed to all extra-constitutional changes of government".
The Economic Community of West African States condemned "the overthrow by putschist soldiers of the democratically elected government".
In a statement, it ordered the closing of regional borders with Mali and suspension of all financial flows between Mali and its 15 members states.
At least 14 people were killed in July in the demonstrations that were called for by a coalition of Keita's political opponents, religious leaders and civil society activists.
Keita had hoped concessions to opponents and recommendations from a mediating delegation of regional leaders would help stem the tide of dissatisfaction, but the protest leaders have rejected proposals to join a power-sharing government.
"Whether he's been arrested or not, what is certain is that his end is near. God is granting our prayers. IBK is finished," Haidara Assetou Cisse, a teacher, said earlier in the day, referring to Keita by his initials.