Mali's President Ibrahim Boubacar Keïta has resigned, after being detained by soldiers on Tuesday.
"I want no blood to be spilled to keep me in power," he said in a televised address. He also dissolved the government and parliament.
Keita and Prime Minister Boubou Cisse had been detained by soldiers in an escalation of a months-long crisis in the country.
Malians took to the streets in the capital Bamako over a week ago, despite rainfall and pleas from mediators to stay home, to demand the resignation of President Ibrahim Boubacar Keita.
The soldiers were expected to deliver a statement on Wednesday, while countries in West Africa, along with former colonial power France, the European Union and the African Union,condemned the actions of the soldiers and warned against any unconstitutional change of power.
The Economic Community of West African States (Ecowas), a regional body, also said its 15 member states had agreed to close their borders with Mali, suspend all financial flows to the country, and eject Mali from all Ecowas decision-making bodies. In recent months, Ecowas has been trying to mediate between Mr Keïta's government and opposition groups
Mr Keïta won a second term in elections in 2018, but there has been anger over corruption, the mismanagement of the economy and a dispute over legislative elections. It has prompted several large protests in recent months.
There has also been anger among troops about pay and over a continuing conflict with jihadists.
The UN Security Council is to meet on Wednesday to discuss the latest developments in Mali.