DAKAR, Senegal — Heavily armed gunmen shouting “Allahu akbar” stormed a Radisson Blu Hotel early Friday in Bamako, the capital of the West African nation of Mali, seizing scores of hostages and leaving bodies strewed across the building.

The gunmen barreled past the hotel’s light security, using fake diplomatic license plates to confuse guards, and then burst into the lobby with their guns blazing.

“They started firing everywhere,” said a receptionist at the hotel who spoke on the condition of anonymity for fear of reprisals. “They were shouting, ‘Allahu akbar,’ ” meaning God is great. “They cut someone’s throat, a white man.”

“I hid in my office,” he said. “I saw four of them, armed to the teeth.”

By late afternoon, the siege appeared to be over, and no more hostages were being held, said Col. Salif Traoré, Mali’s minister of interior security.

United Nations officials said that at least 19 people had been killed, as well as two or three attackers, with bodies found lying in the basement and on the hotel floors. They noted that security forces were still sweeping the building in search of bodies and evidence that would shed more light on the assault.

An American development worker, Anita Ashok Datar of Takoma Park, Md., was killed, as was at least one Belgian citizen. The nationalities of the other victims were not immediately clear.

The gunmen took “about 100 hostages,” said Gen. Didier Dacko of the Malian Army, before soldiers sealed the perimeter and stormed inside, “looking for the terrorists.”

From early on, dozens of guests, including women, children and older people, streamed out of the hotel after hiding in their rooms, many of them crying and barely clothed.

The attack unfolded with 125 guests and 13 employees inside, according to the operators of the hotel. The visitors had come from far and wide, including Europe, India, China, Turkey and Algeria. They included diplomats, businesspeople, pilots and flight attendants.

President Obama condemned the assault from Kuala Lumpur, Malaysia, calling it “another awful reminder that the scourge of terrorism threatens many of our nations.”

The siege in Mali, a former French colony, occurred only a week after terrorists with assault rifles and suicide vests killed 130 people in attacks across Paris.

It was not immediately clear who was responsible for the attack in Mali. Al Jazeera reported that it had received a recording asserting that a local militant group, Al Mourabitoun, had carried out the assault in conjunction with Al Qaeda’s regional affiliate, though the claim could not be independently confirmed.

Image

The body of a victim in front of the hotel in Mali’s capital after the attack by terrorists.CreditBaba Ahmed/Associated Press

France’s defense minister told French television that Mokhtar Belmokhtar, a longtime Qaeda member who claimed responsibility for the 2013 siege of an Algerian gas plant in which dozens of hostages were killed, was “likely behind” the attack in Mali, but he acknowledged that “we are not completely certain of it.”

Mr. Belmokhtar has long been a shadowy figure among extremists. Since June, he has been reported killed at least twice, but American officials concede that he is probably still at large.

Mali has long struggled with insurrection and Islamist extremism, including smaller-scale attacks on a restaurant and another hotel this year.

“We don’t want to scare our people, but we have already said that Mali will have to get used to situations like this,” President Ibrahim Boubacar Keita of Mali, who was visiting Chad, told France 24. He added, “No one, nowhere, is safe, given the danger of terrorism.”

Video

People who escaped the Radisson Blu hotel in Bamako, Mali, which was taken by gunmen, want the authorities to do more to protect them.

Northern Mali fell under the control of rebels and Islamist militants in 2012. A French-led offensive ousted them in 2013, but remnants of the militant groups have staged a number of attacks on United Nations peacekeepers and Malian forces. Hundreds of French soldiers remain in the country.

A peace accord was signed in June between the government and several rebel factions. But the truce has been broken several times, growing lawlessness has driven civilians from the north of the country, and the United Nations peacekeeping mission in Mali is proving to be one of the deadliest in the world. So far 40 peacekeepers have been killed.

United Nations officials said they were worried that the attacks could have been intended, at least in part, to undermine the halting steps toward peace. Some of the people at the hotel were diplomats in town for a meeting to monitor those efforts. In a statement Friday, Secretary General Ban Ki-moon’s office said he “deplores any attempt to derail” the peace process.

The Radisson Blu Hotel is a popular place for foreigners to stay in Bamako, a city with about two million people.

Twelve to 15 Americans were believed to be at the hotel when the gunmen arrived, an American Defense Department official said. About 20 Indian citizens were there but were evacuated safely, the Indian ambassador to Mali said.

Germany’s Foreign Ministry said that two Germans were among the hostages who had been released.

Six Belgians were registered in the hotel, according to a Foreign Ministry spokesman in that country. At least one of them, a 39-year-old Belgian working for the Wallonia-Brussels regional Parliament, died during the attack. He was in Mali for a conference aimed at training Malian civil servants. Another Belgian remained missing, the ministry said.

A diplomat at the Chinese Embassy in Bamako said eight Chinese businesspeople had been trapped in the hotel. Embassy officials at the scene were in touch with some of the Chinese hostages by WeChat, a Chinese messaging service, the diplomat said.

Kassim Traoré, a Malian journalist who was in a building about 160 feet from the Radisson, said the attackers had told hostages to recite a declaration of Muslim faith as a way of separating Muslims from non-Muslims. Those who could recite the declaration, the Shahada, were allowed to leave the hotel. The Shabab, a Qaeda affiliate in East Africa, used a similar approach in the attack at the Westgate Mall in Nairobi, Kenya, in 2013.

Image

People cheered Malian soldiers in front of the Radisson Blu hotel in Bamako, Mali, on Friday.CreditJoe Penney/Reuters

Clément René, 57, a French citizen, came out onto the balcony of his fifth-floor room after he heard repeated gunshots around 7 a.m. One of the attackers, bearing an AK-47, was running into the hotel, shooting back at the hotel security forces.

As shooting intensified, Mr. René fled back into his room, turned off the lights, put his phone on silent mode and waited. “The sound kept coming up as if it was moving from floor to floor,” he said. “The sound of guns, explosions and what seemed to be a grenade.”

He felt as if he was in the middle of the crossfire. “I then sent hundreds of text messages, to my family, my wife and two daughters,” Mr. René said.

He was finally freed from his room by Malian soldiers who stormed the corridor of his floor. In the lobby, he passed a body with a tarp thrown over it.

Video

François Hollande, the French president, and Laurent Fabius, the foreign minister, condemned the attackers in Mali and said France would provide all necessary support.CreditCreditPool photo by Michel Euler

“All I could see were his shoes sticking out,” Mr. René said. “Big black ranger boots, which made me think it might be one of the terrorists.” The glass lobby doors had been shattered.

Kamissoko Lassine, the hotel’s chief pastry chef, said two armed men arrived at the hotel around 7 a.m. “They were driving a vehicle with diplomatic plates,” he said. “You know how easy that is at the hotel? The guards just lifted the barrier.”

“They opened fire and wounded the guard at the front,” Mr. Lassine said. “They took the hotel hostage and moved people into a big hall.”

A member of the United Nations peacekeeping force in Mali said there were many French people in the hotel, including Air France staff members. The airline later said in a statement that 12 of its crew members had been at the hotel and were freed.

Five Turkish Airlines crew members, including pilots and flight attendants, were also freed, while two remained inside the hotel, a Turkish government official said.

Mali has been crippled by instability since January 2012, when rebels and Qaeda-linked militants — armed with the remnants of the arsenal of the Libyan leader Col. Muammar el-Qaddafi — began advancing through the country’s vast desert in the north and capturing towns.

A coup, stirred in part by anger over the government’s handling of the insurrection, ousted Mali’s elected government in March 2012. Amid the chaos, Islamist rebels consolidated their hold on the northern part of the country, imposing a harsh version of Islamic law.

In January 2013, the Islamist forces began advancing south from their northern stronghold, heading in the direction of Mali’s capital. France sent in troops to stop them. A brief military campaign halted the Islamist advance, recaptured cities and towns like Timbuktu that had been under the militants’ control, and chased the remaining Islamist fighters into the desert.

But then, with no warning, other militants linked to Al Qaeda stormed a vast gas production facility in the desert of neighboring Algeria, taking dozens of expatriate workers hostage. Thirty-eight were killed during the siege of the gas plant.

With hundreds of French troops still in Mali and the country highly reliant on donors, elections in 2013 restored a democratic government. But its hold on the north remains weak.

There are frequent attacks by Islamist fighters, in particular on United Nations troops, in the northern provinces. In August United Nations workers were killed in an assault on a hotel in central Mali. Five months before, militants killed five at a restaurant in Bamako.

In the assault in August, jihadists stormed a hotel in Sévaré, north of the capital, where United Nations staff members were staying, seizing hostages and killing at least five Malian soldiers and a United Nations contractor.

Dionne Searcey reported from Dakar, Senegal, and Adam Nossiter from Paris. Reporting was contributed by Cheick Diouara, Katarina Hoije and Serge Daniel from Bamako, Mali; Rukmini Callimachi, Lilia Blaise and Nabih Bulos from Paris; Saskia de Rothschild from Abidjan, Ivory Coast; Jane Perlez from Beijing; Eric Schmitt and Helene Cooper from Washington; Somini Sengupta from the United Nations; and Michael Schwirtz from New York.

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Deadly Siege Ends After an Assault on a Mali Hotel. Order Reprints | Today’s Paper | Subscribe