Mali's interim president and prime minister resigned on Wednesday, a top junta aide said, two days after they were detained and stripped of their powers in what appeared to amount to the country's second coup in nine months.

In New York, the UN Security Council "strongly condemned" the ouster and arrest of President Bah Ndaw and Prime Minister Moctar Ouane, and called for a return to civilian government -- but did not discuss punitive measures.

Coup leader Assimi Goita (C) is currently serving as interim vice president
Coup leader Assimi Goita (C) is currently serving as interim vice president AFP / MICHELE CATTANI

The interim leaders, who had been tasked with steering the return to civilian rule after a coup last August, resigned in the presence of mediators visiting the military base where they were being held, said Baba Cisse, special advisor to junta boss Assimi Goita.

However a member of the Economic Community of West African States (ECOWAS), African Union and UN mission MINUSMA mediation mission told reporters that the leaders had in fact resigned before they arrived.

The delegation then went to speak to Goita -- who holds the rank of vice president in the transitional government -- again after seeing him late Tuesday.

Mali's President Bah Ndaw was detained along with the Prime Minister
Mali's President Bah Ndaw was detained along with the Prime Minister AFP / Michele Cattani

Cisse said the president, prime minister and other transition leaders arrested on Monday would be released but this would happen "gradually for obvious security reasons". He gave no timeline.

He said earlier that there were moves toward forming a new government in the poor Sahel state.

Their detentions triggered widespread international condemnation and the threat of sanctions.

France has sent soldiers to help Mali combat a jihadist insurgency
France has sent soldiers to help Mali combat a jihadist insurgency AFP / Daphné BENOIT

The Security Council, which held an emergency meeting at the request of former colonial power France and others, called for "the safe, immediate and unconditional release of all the officials detained and urged the defense and security forces elements to return to their barracks without delay".

The council urged a restoration of the civilian-led transition, which envisages a return to elections and constitutional order on an 18-month timeline.

But it did not discuss imposing sanctions and refrained from calling the detentions a coup.

AFP / Laurence SAUBADU

The ECOWAS mediators met with Ndaw and Ouane at the Kati military camp around 15 kilometres (nine miles) from the capital Bamako.

A member of the delegation headed by former Nigerian president Goodluck Jonathan had warned that ECOWAS "could quickly announce sanctions" if the crisis is not resolved.

France was also prepared to impose "targeted sanctions", French President Emmanuel Macron said after a European Union summit.

Assimi Goita led a coup last August that overthrew Mali's elected president, Ibrahim Boubacar Keita
Assimi Goita led a coup last August that overthrew Mali's elected president, Ibrahim Boubacar Keita AFP / MALIK KONATE

And Washington said it would "consider targeted measures against political and military leaders who impede Mali's civilian-led transition to democratic governance".

It said the United States had suspended assistance for Mali's security forces.

National Guardsmen in Bamako's Independence Square after transitional leaders sidelined
National Guardsmen in Bamako's Independence Square after transitional leaders sidelined AFP / Michele Cattani

Macron, whose country has committed more than 5,000 troops to Mali's fight against jihadism in the Sahel, condemned the arrest of Ndaw and Ouane as a "coup d'etat in an unacceptable coup d'etat".

On Monday, the United Nations, African Union, ECOWAS, the EU and United States issued a rare joint statement, attacking the detention and demanding the pair be released.

That demand was echoed on Tuesday by Britain and Germany.

A member of Goita's team said that during the talks with the ECOWAS mediators, they had "explained their reasons" for pushing Ndaw and Ouane out, and insisted that elections would still be held next year.

Young military officers ousted president Ibrahim Boubacar Keita last August after weeks of demonstrations over perceived government corruption and his handling of the jihadist insurgency.

ECOWAS, a 15-nation regional bloc, threatened sanctions, prompting the junta to hand power to a caretaker government that pledged to reform the constitution.

Recently there had been signs of public discontent, with the opposition M5 movement demanding a "more legitimate" body.

On May 14, the government said it would appoint a new "broad-based" cabinet.

The reshuffle saw the military keep the strategic portfolios it controlled during the previous administration.

But two other coup leaders -- ex-defence minister Sadio Camara and ex-security minister Colonel Modibo Kone -- were replaced, prompting officers to detain the president and prime minister.

Goita accused Ndaw and Ouane of failing to consult him on the reshuffle and decried what he called a "demonstrable intent to sabotage the transition".

The transitional charter, a document largely drawn up by the colonels, sets down principles for underpinning Mali's return to civilian rule.

"The scheduled elections will be held in 2022," Goita added.