The spokesman for the soldiers said they had acted to prevent the country falling further into chaos.
President Keïta resigned on Tuesday night saying he did not want “blood to be spilled to keep me in power”.
The UN Security Council condemned the “mutiny”, urging the immediate release of the president and his officials.
All troops should “return to their barracks without delay”, it said.
The African Union (AU) voted to suspend Mali. Its 15-member security council called for the “restoration of constitutional order” and the release of the president and other government officials.
Mali, a vast country stretching into the Sahara Desert is among the poorest countries in the world and has experienced several military takeovers. It is currently battling to contain a wave of jihadist attacks and ethnic violence.
The soldiers, calling themselves the National Committee for the Salvation of the People, said they did not want to stay in power.
“We are keen on the stability of the country, which will allow us to organise general elections to allow Mali to equip itself with strong institutions within the reasonable time limit,” said the group’s spokesman, Col Ismaël Wagué, the air force deputy chief of staff.
In a televised statement, flanked by soldiers, he urged Mali’s civil and political groups to help create a “political transition leading to credible general elections for the exercise of democracy through a roadmap that will lay the foundations for a new Mali”.
He also announced the closure of all air and land borders and a curfew from 21:00 to 05:00.
“Our country is sinking into chaos, anarchy and insecurity mostly due to the fault of the people who are in charge of its destiny,” he said.
Wearing a surgical mask amid the coronavirus pandemic, Mr Keïta resigned in a brief address on state television on Tuesday evening.
“If today, certain elements of our armed forces want this to end through their intervention, do I really have a choice?” he asked. “I hold no hatred towards anyone, my love of my country does not allow me to. May God save us.”