DAKAR, Senegal — Boko Haram claimed responsibility Tuesday for abducting more than 300 boys from a secondary school in northwest Nigeria, marking a striking leap from the extremist group's usual area of operation and a chilling expansion of Islamist militancy in West Africa.

Hundreds of gunmen surrounded the boarding school in Katsina state on Friday and opened fire in a community that had never known such violence, witnesses said, before dragging the students deep into the woods.

The mass kidnapping shocked the continent's most populous country as deaths from a multifront conflict in the region soar. West Africa is home to the fastest-growing Islamist insurgencies in the world, conflict researchers say, with unrest by disparate forces gripping Nigeria and three of its regional neighbors: Mali, Burkina Faso and Niger.

Boko Haram has killed at least 36,000 people and displaced millions over the past decade, but the campaign of terrorism has rarely stretched far from its stronghold in the Lake Chad Basin. The assault in the town of Kankara, however, signaled that the fighters’ murderous reach has shifted nearly 500 miles west, endangering peace in new territory.

The extremist footprint is growing five years after Nigerian President Muhammadu Buhari announced that Boko Haram had been “technically defeated.” Yet analysts warn that the group is plotting moves to show its strength on the global stage and wrest more of the nation from the state’s control.

Boko Haram’s leader, Abubakar Shekau, said in a predawn audio message that militants stormed the school in the town of Kankara to discourage “Western education,” according to Nigerian media outlets and researchers who reviewed the recording.

“What happened in Katsina was done to promote Islam and discourage un-Islamic practices,” Shekau said in the audio.

The group set off international outrage in 2014 when it abducted more than 270 girls in the northeastern town of Chibok. Then-first lady Michelle Obama drew attention to the horror with a hashtag that went viral: #BringBackOurGirls.

Shekau — a commander known for bloodthirstiness even among the world’s deadliest extremist organizations — seemed to be sending a message, said Bulama Bukarti, a Boko Haram specialist at the Tony Blair Institute for Global Change in London.

“He wanted to make a big political statement that we are attacking you in the northeast, we are abducting your children in the northeast, and now we are doing it in the northwest,” Bukarti said. “This is a huge announcement — an audacious demonstration of capacity.”

The Science School in Kankara is now empty. More than 800 students studied there before the attack — all boys.

The victims risk being forced into Shekau’s army.

Boko Haram has swollen its ranks over the years by striking towns, kidnapping children and ordering them to join or die. Those who escape often speak of having killed people against their will, leaving the children traumatized and subject to state punishment. They tend to face months of military detention after fleeing Boko Haram to return home, as authorities investigate them for signs of loyalty to the group.

Boko Haram is just one of several insurgencies in West Africa at risk of colliding as they push into new territory. More than 13,000 people have died as a result of conflict in the region this year, according to the Armed Conflict Location and Event Data Project (ACLED), up from 10,126 last year in the most-affected countries.

Groups that have pledged allegiance to al-Qaeda or the Islamic State are driving much of the bloodshed. Each has carved out its own areas of influence that keep spreading.

“The geographic space is indeed narrowing,” said Héni ­Nsaibia, a senior researcher at ACLED.

The Islamic State’s center of gravity has shifted to the continent from Iraq and Syria, according to the 2020 Global Terrorism Index, which tracks geographic threats. Deaths linked to the group surged by 67 percent south of the Sahara desert in 2019.

The Nigerian president initially blamed bandits for Friday’s kidnappings. Gangs in the area are known to abduct people for ransom.

Parents in Kankara took to the streets in protest, urging Nigerian leaders to rescue their children while a new social media trend took hold: #BringBackOurBoys. The Katsina governor told reporters Tuesday that he had made contact with the abductors but did not provide details. He said 333 boys remained missing.

Schools have closed across the state, suspending the education of tens of thousands of students, as security forces search for the abducted boys in the region’s dense forests.

One teenager who escaped the attack in Katsina, speaking on the condition of anonymity because he feared retaliation, told The Washington Post that gunmen struck the campus after dark.

“They split us into groups,” he said, “and led us into different directions in the forest.”

The assailants seemed to be taking orders from someone on the phone, the teenager said, and summoned more men on motorbikes to haul off the boys.

He managed to flee with a classmate when the kidnappers seemed distracted. The pair ran into what he called a good Samaritan on a motorbike, who returned them to Kankara, he said.

“With the way they split us into groups,” he said, “it’s going to be very hard to rescue all of my classmates.”

Boko Haram followed the same strategy with the Chibok girls.

The girls, who had attended a Christian school, were divided up and taken to remote hideouts, where they were forced to convert to Islam and marry fighters. (Girls as young as 9 are “suitable” for marriage, Shekau has said.)

Dozens have been freed over the past four years through government negotiations, activists say, but 112 are believed to remain in captivity.

Ismail Alfa in Maiduguri, Nigeria, contributed to this report.