The attackers seized about 170 hostages at the Radisson Blu Hotel in Bamako, although a Malian army commander later said about 20 hostages had been released.
It was not immediately clear why the group was freed or how many remained held by the militants.
Military commander Modibo Naman Traore said 10 gunmen stormed the hotel shouting “Allahu Akbar” - “God is great” in Arabic - before firing on the guards and taking hostages.
Some guests escaped the hotel. Monique Kouame Affoue Ekonde, an Ivorian, said she and six other people were escorted out by security forces.
Following a military coup in 2012, Islamic extremists took control of northern Mali, prompting a French-led military intervention in early 2013. The extremists were scattered from northern towns and cities, though the north remains insecure and militant attacks have extended south this year.
In March masked gunmen shot up a restaurant popular with foreigners in Bamako, located in Mali’s south, killing five people.
About 1,000 French troops remain in the country. The Netherlands also has troops working with the UN mission in Mali.
According to the Dutch defence ministry, 450 Dutch military personnel are taking part in the mission along with four Apache and three Chinook helicopters. Most of the Dutch force is based in Gao, but there are a few officers at the UN mission headquarters in Bamako.
China’s embassy issued a warning to Chinese businesses and residents to step up safety precautions in the face of “continuous deterioration of security conditions” in Bamako.
China has a long history of providing aid and investment to Mali, particularly in the areas of transport infrastructure, construction and mineral extraction.