Several gunmen seized a luxury hotel in Mali’s capital on Friday, killing at least 20 people in an attack that raised fresh concerns about security in a country that has battled Islamist insurgents for years.

Even after a multinational campaign to defeat them, militants have proved capable of targeting prominent locations like the city’s Radisson Blu Hotel, where the seven-hour standoff took place.

Security forces swept through the Radisson on Friday afternoon, freeing the last hostages and pursuing the gunmen, who had charged through the hotel yelling “Allahu akbar!” — or “God is great!” As the troops cleared the hotel, they found the floors littered with the bodies of Malians and foreign visitors, including a Belgian government official.

The State Department said a U.S. citizen was among the dead. A department spokesman had reported earlier that no Americans were killed or injured.

An al-Qaeda affiliate based in Africa claimed Friday’s attack. It was the latest in a year of deadly Islamist-led assaults across sub-Saharan Africa, where a patchwork of conflicts has sometimes been overshadowed by Islamic State violence in other parts of the world. From al-Shabab in Somalia to Boko Haram in Nigeria, the continent is host to a profusion of violent extremist groups, with a range of local and transnational goals, seeking to execute large-scale attacks against civilians.

The Washington Post's Kevin Sieff talks about the extremist threat in West Africa and why the U.N. peace keeping mission there is now the agency's most dangerous. (Kevin Sieff and Jason Aldag/The Washington Post)

In Mali, Friday’s attack underscored how vulnerable the West African country remains, even after French forces and a small number of U.S. troops helped unseat Islamists from their northern stronghold in 2013. Before that campaign, militants appeared to be gaining ground, moving closer to the capital, seizing on the chaos caused by a 2012 military coup. The current government still has only tenuous influence in parts of the country, and the remaining French forces in particular are considered targets.

The gunmen stormed the hotel early Friday, sending some of the 170 guests and staff members fleeing in panic and prompting others to seek hiding places. One witness said the attackers freed some captives who were able to recite verses from the Koran. By late Friday afternoon, Mali’s security minister, Col. Salif Traore, said the remaining hostages were safe.

At least 20 people were killed, Traore said. The Reuters news agency, citing U.N. officials, said at least 27 bodies were seen. Authorities worked through the evening to identify the dead.

Three U.N. staff members in the hotel during the attack were safely evacuated, said Stéphane Dujarric, spokesman for U.N. Secretary General Ban Ki-moon. U.N. peacekeepers helped secure the perimeter and provided medical aid and forensics assistance, Dujarric said.

The United Nations has envoys in Bamako as part of Mali’s reconciliation efforts — what has become the deadliest peacekeeping mission of the past three years, with 53 U.N. peacekeepers killed since 2013.

The Chinese Foreign Ministry said three Chinese nationals were among the dead and four were rescued.

Meanwhile, security forces tried to pin down the attackers in the heart of Bamako. Officials said that four gunmen were holed up Friday night in a hotel room but that there were no hostages with them.

A group affiliated with al-Qaeda, al-Mourabitoun, said its followers were behind the attack — similar to a smaller assault on a hotel in August that was claimed by the same group. Mali has faced repeated attacks from insurgents linked to al-Qaeda and other factions, but the Islamic State does not have major footholds in the region.

One Senegalese guest, Aissatou Gueye, was in her room when the attackers entered. Like many other guests, she was there to attend a large mining conference. “They were asking people to recite the Koran, and if they do, nothing will happen to them,” she said outside the hotel. Gueye saw one person shot dead before she ran to safety.

About a dozen Americans were rescued from the hotel, including several employees of the U.S. Embassy in Bamako, said State Department spokesman John Kirby.

The American victim was identified by her family as Anita Datar, an international development worker from Takoma Park, Md. The U.S. ambassador to Mali called the family late Friday afternoon to inform them, Datar’s mother said. Datar, the mother of a young son, worked for Palladium, an international development firm with offices in Washington.

A member of a U.S. Special Operations unit helped to escort guests evacuated from the hotel, the Pentagon said. About 22 U.S. Defense Department personnel were in Bamako when the hotel was attacked.

President Obama, speaking to business leaders at a summit in Kuala Lumpur, Malaysia, expressed condolences to the people of Mali. “Mali security forces and our own diplomatic and security agencies rushed in to save lives,” Obama said. “This barbarity only stiffens our resolve to meet this challenge. We will stand with the people of Mali to rid the country of terrorists and strengthen their democracy.”

Authorities drew no direct links to last week’s terrorist attacks in Paris. But Mali — home to the ancient city of Timbuktu — has been at the center of a French-backed effort to drive back Islamist rebels who once controlled large portions of the country.

Security had been reinforced in Bamako — specifically around locations popular with foreigners, including the Radisson — after the Paris attacks, Traore said. He added that the attackers entered the hotel through a side entrance, “which makes us believe that they were familiar with the hotel.”

Foreigners are often targeted in Mali. Yet militants had never seized a target as prominent as the 190-room Radisson Blu, where foreign business people and diplomats are known to stay and dine.

Earlier this month — before the rampage in Paris — the leader of Ansar Dine, one of Mali’s main Islamist groups, released a statement encouraging attacks that would “push away the aggression of the French Crusader assailant” in the former French colony, which stretches from tropical West Africa to desert regions bordering Algeria.

A contingent of French troops is stationed in Mali, and President François Hollande on Thursday had praised the campaign against the Islamist insurgents.

“France is leading this war with its armed forces, its soldiers, its courage,” he said. “It must carry out this war with its allies, its partners giving us all the means available, as we did in Mali, as we are going to continue in Iraq, as we will continue in Syria.”

One of the rescued hostages, popular Guinean singer Sékouba “Bambino” Diabate, told reporters that he hid under his bed and heard two assailants speaking in English as they searched an adjacent room.

“I stayed still, hidden under the bed, not making a noise,” he said. “I heard them say in English: ‘Did you load it? Let’s go.’ ”

Extremist violence has hit Mali repeatedly. In March, attackers reportedly shouting “Allahu akbar” fired on a popular bar in Bamako. Three Malian civilians were killed, along with a Belgian security officer working for the European Union and a French national.

Two months ago, more than a dozen people — including five U.N. contractors — were killed in a 24-hour hostage siege at a hotel in Sevare in central Mali. Responsibility for that attack was claimed by al-Mourabitoun, led by Algerian Mokhtar Belmokhtar.

Belmokhtar, an infamous one-eyed militant, had also orchestrated the bloody seizure of an Algerian gas facility in 2013 in which at least 100 workers were held hostage and dozens were killed. He was targeted in a U.S. airstrike in June in Libya, and Libyan authorities said he was killed. But the Islamist group al-Qaeda in the Islamic Maghreb rejected that claim.

Sieff reported from Nairobi. Carol Morello, Brian Murphy, William Branigin, Sarah Kaplan, Craig Whitlock and Joe Heim in Washington, David Nakamura in Kuala Lumpur and Liu Liu in Beijing contributed to this report.

Read more:

Three attacks deepen fears of Islamic State’s reach

It’s not just the Islamic State. Other terror groups surge in West Africa.