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.
The Brussels-based Rezidor Hotel group that operates the hotel said the assailants “locked in” 140 guests and 30 employees, before Mr Traore said 20 had been released.
Any number of Muslim extremist groups could be behind the attack, which unfolded a week after the attacks on Paris that killed 129 people. A handful of jihadi groups seized the northern half of Mali in 2012 but were ousted from cities and towns by a French military intervention.
A staffer at the hotel who gave his name as Tamba Diarra said over the phone that the attackers used grenades in the assault.
The US embassy in Mali asked citizens to shelter in place amid reports of an “ongoing active shooter operation” at the hotel. People in the area ran for their lives along a dirt road as a soldier in full combat gear escorted them to safety.
A French official said French citizens were in the hotel but could not give more details because their number and identities were not confirmed.
Chinese state broadcaster CCTV reported that about 10 Chinese citizens were sheltering inside their hotel rooms. The Chinese embassy was in phone contact with them and all were reported safe, according to the report. All are employees of Chinese companies working in Mali.
Five Turkish Airlines personnel were among the freed hostages, Turkey’s state-run news agency said.
The website of the official China Daily newspaper also cited an unidentified witness as saying one Chinese citizen had been rescued.
The UN mission said it was sending security reinforcements and medical aid to the scene. Ambulances were seen rushing to the hotel as a military helicopter flew overhead.
Following a military coup in 2012, Islamic extremists took control of northern Mali, prompting a French-led military intervention in early 2013 that forced the extremists from northern towns and cities, though the north remains insecure and militant attacks have extended farther 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.
Air France later cancelled flight 3852 from Paris to Bamako.
Mali’s President Ibrahim Boubacar Keita has cut short its tip to Chad where he was attending a meeting of regional leaders.
The Mali presidency said on Twitter that Mr Keita will be back to Bamako “in the next hours”.
Meanwhile, France’s national security service said about 50 elite police troops are en route from Paris to Bamako.
A spokesman for the service said they are heading from two different units of special police forces trained for emergency situations.
French President Francois Hollande said France is ready to help Mali with all means necessary.
He urged all French citizens in Mali to make contact with the French embassy “in order that everything is made to offer them protection”.
In Belgium, foreign minister Didier Reynders said there were four Belgians registered at the hotel but it is unclear if they were taken hostage.
Mr Reynders also said there are “15 hostages who have been freed after an intervention” but did not provide more details.