A Malian police officer stands guard on an armored vehicle outside the Campement Kangaba tourist resort near Bamako, Mali, on Monday. (Baba Ahmed/Associated Press)

An al-Qaeda-linked Islamist group said Monday that it staged an attack the previous day on a resort area in Mali popular with foreigners, killing five people, including a Portuguese soldier who had
been serving in the European Union mission to stabilize this West African country racked by mounting extremism.

The recently formed Mali-based Nusrat al-Islam wal Muslimeen extremist group has asserted responsibility for the attack, according to the SITE Intelligence Group, which monitors Islamist militant websites.

A Malian soldier and three civilians — a Chinese citizen, a Malian and a French-Gabonese dual national — also were slain in the deadliest terror attack to strike Bamako since late 2015.

E.U. foreign policy chief Federica Mogherini said the Malian victim worked for the European delegation in Bamako.

The attack struck a resort area that was considered safe enough that it was an approved rest and recreation location for soldiers with the E.U. mission. It was not immediately clear how the attackers managed to overpower the security staff and shoot at guests.

Mali’s special forces arrived at the scene not long after the reports of gunfire erupting from Campement Kangaba, known for its three swimming pools and serene surroundings as an escape from the bustling capital’s heat and traffic.

Initially, the country’s security minister said one of the wounded attackers had escaped, but on Monday officials said they had accounted for all the militants.

“At this hour, all of the terrorists have been killed. The situation is under control,” said Mali’s security minister, Salif Traoré.

Witnesses described a chaotic scene Sunday afternoon, with one man saying the first attacker on the scene arrived by motorcycle shouting “Allah akbar.” Three others subsequently arrived in a vehicle and began firing their weapons. One of the attackers was subdued by a French soldier who was staying at Campement Kangaba for the weekend, according to a witness at the scene. The attacker was wounded and later died.

The attack took place during the final week of the Muslim holy month of Ramadan.

Sunday’s violence also 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.

In March 2015, five people died when militants attacked 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.