The Malian military have released the country's interim leaders but taken control of the government, sources said on Thursday, in moves that have fallen far short of international demands to resolve the deep crisis.

President Bah Ndaw and Prime Minister Moctar Ouane were released overnight, a military official said, three days after they were detained and then stripped of their powers in what appeared to be the country's second coup in nine months.

"The interim president and prime minister were released overnight around 1:30 am (0130 GMT). We were true to our word," the official told AFP, speaking on condition of anonymity.

Family members confirmed the pair had been freed and had returned to their homes in the capital Bamako, although the circumstances surrounding their release were unclear.

Released: Interim president Bah Ndaw
Released: Interim president Bah Ndaw AFP / Michele Cattani

"I am well. I was released last night and am at home," Ouane told AFP without giving further details.

The transitional leaders had been tasked with steering the return to civilian rule after a coup last August that toppled Mali's elected president, Ibrahim Boubacar Keita.

Keita was forced out by young army officers following mass protests over perceived corruption and his failure to quell a bloody jihadist insurgency.

But in a move that sparked widespread diplomatic anger, Ndaw and Ouane were detained on Monday by army officers who were apparently disgruntled by a government reshuffle.

Strongman: Colonel Assimi Goita
Strongman: Colonel Assimi Goita AFP / ANNIE RISEMBERG

The two were held at the Kati military camp around 15 kilometres (nine miles) from Bamako.

The interim government -- installed under the threat of regional sanctions -- has the declared aim of restoring full civilian rule within 18 months.

A man prays in the recently liberated town of Douentza, Mali on Jan. 28, 2013 REUTERS

But its appointments were heavily influenced by the military.

Colonel Assimi Goita, who headed the post-coup junta, was named vice president and other key posts were given to army officers.

On Tuesday, Goita said Ndaw and Ouane had been stripped of their powers.

He accused Ndaw and Ouane of failing to consult him on the reshuffle, which amounted to "demonstrable intent to sabotage the transition."

The following day, the pair resigned in the presence of mediators visiting the base at Kati as diplomatic pressure began to mount.

The UN Security Council, staging an emergency meeting at the request of former colonial power France and others, demanded "the safe, immediate and unconditional release" of the duo and urged a restoration of the civilian-led transition.

But Goita told the mediators that he intended to head the transitional government himself and name a prime minister, diplomats said.

Goita "is in charge of the transitional presidency until further orders," a senior military official said, speaking on condition of anonymity.

The Security Council did not discuss imposing sanctions and refrained from calling the detentions a coup.

In contrast, French President Emmanuel Macron, whose country has committed more than 5,000 troops to fighting jihadism in the Sahel, said the twin arrests were a "coup d'etat in an unacceptable coup d'etat."

France, the United States and the regional bloc ECOWAS have also warned of sanctions, and US aid to the Malian armed forces has been suspended.

Thousands of people have died, and hundreds of thousands have fled their homes, since a jihadist revolt began in northern Mali in 2012, later spread to the centre of the country and then into neighbouring Niger and Burkina Faso.

Mali is one of the poorest in the world, and its armed forces suffer from lack of equipment and training. They are being supported by UN and French troops, as well as a combined force from four other Sahel nations.