Al-Qaeda's North African affiliate says a group linked to it carried out the suicide attack that killed at least 50 people in northern Mali.
A vehicle packed with explosives detonated at a camp housing soldiers and members of rival armed groups in the region's main city, Gao.
Mali's northern desert region has been restive since it was captured by militant Islamists in late 2012.
Despite French military intervention in 2013, the region remains tense.
Al-Qaeda in the Islamic Maghreb (AQIM) said the suicide bombing was meant to punish rebel groups co-operating with France, according to a statement obtained by the SITE Intelligence Group.
AQIM said a group called al-Mourabitoun was responsible and named the bomber it said carried out the attack. Malian media had earlier suggested several bombers took part.
Suspected jihadists crying "Allahu Akbar" stormed a tourist resort popular with foreigners on the edge of the Malian capital Bamako on Sunday, briefly seizing more than 30 hostages and leaving at least two people dead.
The assault on the Kangaba Le Campement resort comes after a similar strike less than two years ago on a luxury hotel in Bamako, which lies in the south of the troubled country.
Four assailants were killed by security forces, Mali's security minister said late Sunday, without specifying if more were on the run.
Nearby residents had first reported the attack after hearing shots while smoke billowed into the air, with at least one building ablaze.
"It is a jihadist attack. Malian special forces intervened," Security Minister Salif Traore said, adding that two people had been killed, including a Franco-Gabonese.
He later told journalists that we have recovered the bodies of two attackers who were killed and were searching for the bodies of two others.
We were able to rescue around 36 guests and workers from the resort, including around 15 French nationals and a similar number of Malians, he added.
The special forces were supported by UN soldiers and French counter-terrorism troops.
Mali's army earlier said that one of the attackers was wounded and gave up his weapon. He also left behind bottles containing some explosive substances, the security ministry said.
At least 14 people, both Malians and foreigners, were injured, according to the ministry.
A witness interviewed on local television ORTM said he saw a man arrive on a motorcycle who started shooting at the crowd followed by two or three people who came in another vehicle.
The landlocked west African country has been fighting a jihadist insurgency for several years, with Islamist fighters roaming the north and centre of Mali.
French President Emmanuel Macron, who is scheduled to visit Bamako on July 2 for a meeting with five Sahel countries, is following the situation very closely, the presidency said.
The victims were involved in conducting patrols in this highly volatile area under a deal backed by the UN in a bid to stop the violence there.
The accord between the government and rebel groups was signed in June 2015.
Al-Mourabitoun also said it was behind the hostage-taking at the Radisson Blu hotel in the Malian capital, Bamako, in November 2015, and a deadly raid on the Splendid Hotel in the capital of Burkina Faso, Ouagadougou, in January 2016.
Gao in northern Mali was at the cradle of rebel uprisings and a sanctuary for Islamist fighters.
It is not the first time the military in Mali has been targeted by a deadly attack.
Several people rescued at Kangaba said assailants had shouted "Allahu Akbar (God is Greatest)".
The US embassy in Bamako had warned earlier this month of a possible increased threat of attacks against Western diplomatic missions, places of worship, and other locations in Bamako where Westerners frequent.
At a France-Africa summit in Bamako in January, the owner of Kangaba, Herve Depardieu, had complained about the alarming security information given by foreign consulates which seriously disturb our love of life and our freedoms.
In November 2015, gunmen took guests and staff hostage at the luxury Radisson Blu hotel in Bamako in a siege that left at least 20 people dead, including 14 foreigners.
That attack was claimed by Al-Qaeda's North African affiliate Al-Qaeda in the Islamic Maghreb (AQIM).
In March the same year, a grenade and gun attack on La Terrasse nightclub in Bamako killed five people, including foreigners.
The Kangaba, located on the eastern edge of Bamako, boasts accommodation in hut-style rooms, as well as restaurants and swimming pools, according to its website.
- State of emergency - A state of emergency has been renewed several times since the Radisson Blu attack, most recently in April when it was extended for six months, but attacks are continuing.
In 2012 Mali's north fell under the control of jihadist groups linked to Al-Qaeda who hijacked an ethnic Tuareg-led rebel uprising, though the Islamists were largely ousted by a French-led military operation in January 2013.
But jihadists have continued to mount numerous attacks on civilians and the army, as well as on French and UN forces still stationed there.
The unrest has continued despite a 2015 peace deal between the government and Tuareg-led rebels offering partial autonomy to the north.
Sunday's attack is the latest in a series of high-profile assaults in north and west Africa, targeting locals and tourists.
In January 2016, 30 people were killed, including many foreigners, in an attack on a top Burkina Faso hotel and a nearby restaurant in the capital Ouagadougou. AQIM claimed the assault, saying the gunmen were from the Al-Murabitoun group of Algerian extremist Mokhtar Belmokhtar.
In March 2016, at least 14 civilians and two special forces troops were killed when gunmen stormed the Ivorian beach resort of Grand-Bassam, which was also claimed by AQIM.
The United Nations has a 12,000-strong force in Mali known as MINUSMA, which began operations in 2013.
It has been targeted constantly by jihadists, with dozens of peacekeepers killed, including five on Saturday.
France also has 4,000 soldiers in its Bakhane force in five countries, Mali, Mauritania, Niger, Chad and Burkina Faso all of which are threatened by the jihadists across their porous borders.
In July last year, about 17 soldiers were killed and 30 others wounded in an attack on a military base in the central town of Nampala.
Mali's President Ibrahim Boubacar Keita has declared three days of national mourning in a tweet following the latest attack.
The fight against extremist groups is one of the major challenges of Mr Keita's government.
But a new report by Human Rights Watch says the Malian government is not doing enough to protect civilians from the militants.
Wednesday's attack shows that even soldiers aren't safe.
If the security situation continues to deteriorate, then soon there won't be any peace to keep in Mali, UN peacekeeping chief Herve Ladsous told the UN Security Council.