Mali's President Ibrahim Boubacar Keita announced his resignation effective immediately in the early hours of Wednesday morning, hours after being detained by mutinying soldiers.
In an address on state television, the 75-year-old also said that both the government and the national assembly would be dissolved.
"I would like at this precise moment, while thanking the Malian people for their support throughout these long years and the warmth of their affection, to tell you of my decision to relinquish my duties," Keita said.
The announcement comes after rebel soldiers detained both Keita and the prime minister, Boubou Cisse, on Tuesday. It also comes after months of political tensions and sometimes-lethal protests in the Sahel state.
The president and the prime minister were detained on Tuesday after soldiers mutinied at the Kati army base outside of capital Bamako and rounded up a number of senior civilian and military officials.
Video footage have emerged on social media showing a convoy of vehicles surrounded by troops, with some users alleging that the president had been taken into custody.
The M5-RFP coalition in Mali behind mass protests calling for the president to resign said Keita's detention on Tuesday by mutinying soldiers was "not a military coup but a popular insurrection."
"IBK did not want to listen to his people. We even proposed an alternative but he responded with killings," Nouhoum Togo, spokesman for the M5-RFP coalition, told Reuters, referring to Keita by his initials.
The Economic Community of West African States (ECOWAS) said it had decided to close its member states' borders with Mali after its president was detained and it was also suspending all financial flows between its 15 members and Mali and suspending Mali from its decision-making bodies.
The mutiny has been condemned by ECOWAS, which said in a statement the act would complicate "an already very complex socio-political context."
ECOWAS urged the Mali military to return to their barracks and reiterated calls for dialogue to resolve the crisis facing the country.
The mutiny has also been condemned by the African Union and Mali's former colonial power France.
"I forcefully condemn the arrest of President Ibrahim Boubacar Keita, Prime Minister (Boubou Cisse) and other members of the Malian government, and call for their immediate release," the chairman of the AU Commission, Moussa Faki Mahamat, said in a tweet in French.
Earlier, Cisse urged mutinying soldiers to stand down and called for dialogue to resolve the crisis.
Reports of the mutiny first emerged after gunfire was heard at an army base outside Bamako.
Malian troops and citizens gather outside the private residence of Mali's President Ibrahim Boubacar Keita in Bamako, Mali, August 18, 2020. /AP
Protests broke out in June, led by an opposition coalition after a contested local election and perceived government corruption. Protesters accused the president of allowing the country's economy to collapse and mishandling a worsening security situation.
The opposition June 5 Movement, named for the date of its first protest, has been channeling deep anger over a dire economy, perceived government corruption and a brutal jihadist conflict.
The opposition alliance's anti-Keita campaign veered into crisis last month, when at least 14 protesters were killed during three days of clashes with security forces, according to the United Nations and human rights activists.
Back in 2012, a mutiny at the same base in Kati toppled then-President Amadou Toumani Toure. Keita won the election organized by the civilian transitional government next year.
Political tension has been simmering following the reelection of President Keita in 2018, in a poll that opposition parties said was marred by irregularities.
Underscoring the fear of Mali falling into further disarray over the current political crisis, ECOWAS stepped in last month to mediate and urged Keita to share power in a unity government.
The 75-year-old president has also proposed some concessions, but these moves have been roundly rejected by opposition leaders who remain steadfast in calling for Keita's departure.
(With input from agencies)