Malian interim President Bah N'Daw and Prime Minister Moctar Ouane have been released after they were detained at the start of the week.
An adviser, who is close to Ouane but wished to remain anonymous, said the two had been released in the early hours of Thursday morning from a military camp in Kati, 15 kilometres northwest of Bamako.
On Tuesday, Malian Vice President Assimi Goita announced that N'Daw and Ouane had been deposed and promised new elections in 2022.
N'Daw and Ouane have not commented on the situation. They were arrested late on Monday, shortly after issuing a decree appointing a new cabinet.
The military filled key posts in the new cabinet but two senior military officers from the military junta that ousted president Ibrahim Boubacar Keita in August were excluded.
The international community, including the United Nations, Germany and France, have condemned the leaders' detention.
France labelled the move a "coup," threatened to impose sanctions and called on the UN Security Council to act.
The West African regional alliance ECOWAS sent a mediation team to Bamako on Tuesday.
The junta that had overthrown Keita was only dissolved in January.
Under pressure from ECOWAS, a transitional government was formed with former defence minister N'Daw at its helm.
The new government was supposed to strike a balance between the interests of the army and of civil society, reform the constitution and hold elections within 18 months.