Until Friday night, Burkina Faso was a country that appeared to be off the radar of Islamist extremist groups, engrossed in its own coups and counter­-coups, seemingly forgotten by the militants waging attacks to its north and east.

Then, after sunset, gunmen stormed the Splendid Hotel in the capital, Ouagadougou, taking more than 100 hostages and forcing the country to rethink the threats it faces as Islamist groups in sub-Saharan Africa seek new high-profile targets. By the time the attack was over Saturday, at least 23 people were dead, according to Burkina Faso’s president, Roch Marc Christian Kaboré.

According to news services, an American, identified Saturday by the U.S. State Department as Michael James Riddering, was killed in the attack. The Associated Press reported that he was a 45-year-old missionary who was meeting a group that was going to volunteer at the orphanage and women’s crisis center he ran with his wife when the attack began.

Adding to the mystery and shock surrounding the attack, Kaboré told reporters that two of the four assailants were women. An al-Qaeda affiliate with roots in northwest Africa asserted responsibility for the attack.

Even after a week of terrorist assaults on unusual targets — first a tourist district in Istanbul, then a business quarter in Jakarta, Indonesia, both attacked by Islamic State sympathizers — the seizure of the Splendid Hotel raised questions about the militant group’s apparent movement well beyond its traditional power bases.

That expansion has been ­particularly true of groups in ­sub-Saharan Africa. Islamist extremist group al-Shabab was born in Somalia, but by 2010 it began carrying out attacks in Uganda and Kenya in retaliation for a multinational military campaign on Somali soil. Boko Haram expanded far beyond its base in northeastern Nigeria, sending suicide bombers to Niger and Chad.

Al-Qaeda in the Islamic Maghreb was founded in the ­Sahel of northwestern Africa, with a strong Algerian influence, but Friday it proved that it would continue to expand it target range.

The group posted a statement online saying the hotel attack in Burkina Faso was aimed at punishing France and the “disbelieving West,” according to a translation from the SITE Intelligence Group.

The reference to France might explain why attackers chose Ouagadougou. In 2014, the French military launched Operation Barkhane to counter the growth of jihadist groups in northern and western Africa, deploying 3,000 troops in five of its former colonies. One of them was Burkina Faso, a majority-Muslim country, where a special forces base was built in Ouagadougou.

“They can see a big crusade that France is undertaking and they see it failing,” said Jeremy Keenan, a professor at the University of London’s School of Oriental and African Studies. “It’s fertile ground for extremists to recruit even more.”

“France has a big military base in Ouagadougou, and in that way it’s as big a target as any other place,” Keenan said.

France’s troop presence was on display during the attack, as French soldiers worked with local forces to track down and kill the four terrorists and evacuate at least 126 people. The Splendid Hotel had been chosen as a target, some surmised, because of its international clientele, including French guests.

French President François Hollande called the assault an “odious and cowardly attack.”

Those who saw the hotel and the surrounding area during the operation described a gruesome scene. At least 10 people were killed in the Cappuccino Cafe, a restaurant next to the hotel, according to the Associated Press. The cafe is owned by an Italian man; his wife and 5-year-old daughter were slain in the attack, the AP reported.

Witnesses said the assault began when assailants set fire to vehicles outside the hotel. Once they entered, the attackers took hostages, and flames engulfed the area. The battle to regain control of the hotel took about 12 hours, leaving desperate relatives of hostages with little idea of what was happening inside.

Even hours after the attack, the death toll remained uncertain. While Kaboré reported that at least 23 had been killed, the French ambassador in Burkina Faso told reporters that at least 27 were dead.

The attack was strikingly similar to an operation in November, when militants claiming allegiance to two groups — al-Qaeda in the Islamic Maghreb and al-Mourabitoun — held hotel guests hostage at the Radisson Blu in Mali’s capital.

That attack, which killed 20, was seen at least in part as a strike against France, which sent thousands of troops to Mali in 2013 to expel militants who had taken over the country’s vast northern region.

Now, in Burkina Faso, a newly elected president in one of the region’s least stable democracies will confront yet another challenge. The country has faced a tumultuous year, after President Blaise Compaoré was overthrown during large protests in October 2014. Last September, forces allied with Compaoré staged a failed coup against the transitional government. In November, voters chose Kaboré, a former prime minister, as the new president. The political upheaval has threatened to slow the economy of what was already a poor nation.

“We appeal to the people to be vigilant and brave because we must fight on,” Kaboré said in a radio address Saturday.

France’s war in Mali has not been able to end extremist violence

I’ve seen the Taliban’s brutality in Afghanistan. Boko Haram might be worse.

Burkina Faso elections mark turning point in country’s political turmoil