Moussa Ag Infahi, director of the national police, told The Associated Press that three of the assailants had been killed while a fourth escaped.
Gunfire first rang out at the Campement Kangaba on the outskirts of Bamako in the late afternoon, according to a security guard who was working at the time.
Mahamadou Doumbia said a militant on a motorcycle entered the area around 3:40 p.m. and cried "Allah Akbar" before jumping off and running toward the pool area.
"Then a car with three jihadis entered the resort and they started to fire their weapons," he said. "A French soldier who had come for the weekend but had his gun shot and wounded" a jihadi.
Mali's security minister later issued a statement confirming at least two deaths, one of which was a dual French-Gabonese citizen.
As night fell, witnesses saw smoke rising from the Campement Kangaba, which features three swimming pools and is a popular escape from the Malian heat. It was not immediately clear what was burning, although extremists in other attacks have set cars ablaze.
There was no immediate claim of responsibility for the attack, which took place amid the final week of the Muslim holy month of Ramadan. In predominantly Muslim Mali, people have been fasting from sunrise to sundown for three weeks.
Sunday's violence came about a week after the U.S. State Department warned of possible attacks on Western diplomatic missions and other locations in Bamako that Westerners frequent.
A U.N. official who spoke on condition of anonymity as he was not authorized to speak to journalists said those at the resort when the attack began included people affiliated with the French military mission, as well as the U.N. and European Union missions in the country.
Religious extremism in Mali once was limited to northern areas, prompting the French military in 2013 to lead a military operation to oust jihadis from power in the major towns in the north. But the militants have continued targeting Malian forces and peacekeepers, making it the deadliest U.N. mission in the world.
There are no French troops based in Bamako, but about 2,000 French troops are based in northern Mali fighting Islamic extremists.
French President Emmanuel Macron was informed about the attack and was following the events carefully, according to an official in his office.
In recent years, the extremists have become even more brazen, attacking sites frequented by Westerners. In March 2015, five people died when militants hit a popular restaurant in the capital. A devastating attack on the Radisson Blu Hotel in Bamako later that year left 20 dead - six Malians and 14 foreigners.
That attack was jointly claimed by both the regional al-Qaida affiliate and a group known as Al Mourabitoun, which was founded by Moktar Belmoktar after he fell out with al-Qaida leaders.
In a video released in March, jihadis said those two were joining together along with two Mali-based terror groups.
Associated Press writers Krista Larson in Dakar, Senegal, and Angela Charlton in Paris contributed.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.