Mali's President Ibrahim Boubacar Keita announced his resignation with immediate effect in the early hours of Wednesday morning, a day after rebel soldiers launched a coup.
In an address on state television, the 75-year-old also said that both the government and Mali's 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," Mr Keita said.
The announcement comes after rebel troops seized the Malian president and Prime Minister Boubou Cisse in a dramatic escalation of a months-long crisis.
Neighbouring states in West Africa, along with France, the European Union and the African Union, condemned the sudden mutiny and warned against any unconstitutional change of power in the fragile country.
UN Secretary-General Antonio Guterres demanded the "immediate and unconditional release" of Mr Keita and Mr Cisse as diplomats in New York said the Security Council would hold emergency talks on Wednesday.
"We can tell you that the president and the prime minister are under our control" after they were "arrested" at Mr Keita's residence in the capital Bamako, a rebel leader, who requested anonymity, told AFP.
Boubou Doucoure, who works as Mr Cisse's director of communications, confirmed that the pair had been detained and had been driven in armoured vehicles to an army base in the town of Kati, about 15 kilometres away.
Mutineering troops had seized the base hours earlier before taking control of the surrounding streets and driving in convoy to the capital Bamako, according to an AFP journalist.
A 2012 putsch that opened the way to Mr Keita's presidency began in the Kati base - and fears quickly grew of another coup attempt in the notoriously unstable country.
Jubilant crowds in the city centre, which had gathered to demand Mr Keita's resignation, cheered the rebels as they made their way to the 75-year-old's official residence.
As the day unfolded, the West Africa bloc ECOWAS, the United States and France released separate statements voicing deep concern about the turn of the events and urged against regime change.
French President Emmanuel Macron had also discussed the crisis with his counterparts in Nigeria, Ivory Coast and Senegal and expressed his "full support for the ongoing mediation efforts of West African states".
His office had added that he "condemned the attempted mutiny underway".
The AU said in a statement that it "forcefully condemns" the arrest of Malian political leaders, while the EU denounced what it called an "attempted coup."
The United States' envoy to the region, J. Peter Pham, joined the calls for restraint and echoed its opposition to any "extraconstitutional" change.
'Shifts in mood'
Mr Keita and Mr Cisse's sudden detention came on the heels of an apparently conciliatory message from the government in Bamako - which had urged the soldiers to engage in dialogue.
"The observed shifts in mood reflect a certain frustration that may have legitimate causes," Mr Cisse's office said in a statement, without offering further details.
It added that the government was open to "fraternal dialogue in order to remove all misunderstandings".
The drama coincided with opposition plans to resume protests against Mr Keita.
Mali has been in the grip of a deep political impasse since June, with the 75-year-old president facing increasingly strident demands for his resignation.
So called after the date of its first protest, the June 5 Movement has been channeling deep anger over a dire economy, perceived government corruption and a brutal jihadist conflict.
But its anti-Keita campaign veered into crisis last month when at least 11 people were killed during clashes with security forces, over three days of unrest following a protest.
Rising tensions
Mali is the linchpin of French-led efforts to roll back jihadists in the Sahel, and its allies neighbours are anxious to avoid the country sliding into chaos.
Swathes of its territory are already outside of the control of the government, which is struggling to contain an Islamist insurgency which first emerged in 2012 and has claimed thousands of lives.
The failure to end that conflict has fuelled frustrations with Mr Keita's rule in Mali, say commentators.
Tensions were also revived in April, when the government held long-delayed parliamentary election whose results are still disputed.
ECOWAS on July 27 suggested the formation of a unity government while sticking by Keita, but the compromise was bluntly rejected by the June 5 Movement.
The coalition on Monday vowed to press ahead with its campaign to force Mr Keita to step down.
It declared it would stage daily protests that would culminate in a mass rally in Bamako on Friday.