At least one gunman entered La Terrasse in an area of Bamako popular with expatriates shortly after midnight and opened fire, according to police and an AFP correspondent on the scene in the aftermath.
"This is a terrorist attack, although we're waiting for clarification. Provisionally, there are four dead -- one French national, a Belgian and two Malians," a policeman told AFP, adding that the dead included a police officer.
The United Nations MINUSMA peacekeeping force later clarified that a third Malian had died, and that reports that a third European was dead were incorrect. Firefighters carried the body of the French national from the restaurant in Bamako's lively Hippodrome district, according to an AFP correspondent who witnessed the aftermath.
In moments after the attack, the body of the police officer and a guard of a private home could be seen in the street outside, while a little further on the body of the Belgian national was also visible.
Dozens of police officers secured the area but the few witnesses to the attack were initially refusing to testify, fearing reprisals.
The French embassy in Bamako issued a message to all French nationals in the city to exercise caution if they had to leave their homes.
Mali's vast desert north is riven by ethnic rivalries and an Islamist insurgency, and has struggled for stability and peace since a coup in 2012.
Jihadists linked to Al-Qaeda controlled an area of desert the size of Texas for more than nine months until a French-led military intervention in 2013 that partly drove them from the region.
The West African nation is also struggling with a militant Tuareg movement that has launched four uprisings since 1962 to fight the army over the territory they claim as their homeland and call Azawad.
But day-to-day life in the capital has been largely unaffected by the northern conflict, and bloodshed blamed on terrorism is rare in the city of 1.8 million.