JOHANNESBURG, South Africa — Gunmen in northern Nigeria burst into a college dormitory early Sunday morning, spraying bullets and killing students indiscriminately, in an attack that carried an echo of the terror eight days earlier at a shopping mall in Kenya.
At least 40 people were killed, according to authorities.
Like the Nairobi attack, the gunmen are believed to come from a violent Islamist group with a long history of indiscriminate attacks, often killing Muslim civilians.
Boko Haram, the Nigerian terror group that authorities blamed for the college attack, is believed to have links with Al Qaeda affiliates in West Africa. The Shabab, the group that claimed responsibility for the Nairobi shopping attack that killed 67 civilians and soldiers, is affiliated with Al Qaeda.
Terror attacks in West and East Africa have risen sharply in recent years, underscoring how easy it is for militant groups to entrench themselves in countries with porous borders and corrupt officials. When security forces launch indiscriminate attacks that kill and maim civilians — as both Nigerian and Kenyan forces have been accused of doing — the backlash can feed support for extremist groups, according to rights groups such as Human Rights Watch.
The attack in the town of Gujba, near Damaturu, the capital of Yobe state, came as students in the college were sleeping in their dormitory at a local college of agriculture.
"They attacked our students while they were sleeping in their hostels," the school provost, Molima Idi Mato, told Associated Press.
Although there was no immediate claim of responsibility, the attack bore the hallmarks of Boko Haram, which is opposed to secular education and has carried out many attacks on schools and colleges.
The group's name means "Western education is a sin" in the local Hausa language.
The group is seeking to impose Sharia law across Nigeria, a country divided between the poverty-stricken north, populated mainly by Muslims, and the predominantly Christian south.
Boko Haram has killed thousands of people in recent years in an insurgency that extends across most of Nigeria's northern states.
Nigerian President Goodluck Jonathan imposed a state of emergency in many northern states in May, but security forces have struggled to defeat Boko Haram.
Civilian vigilante groups have sprung up, rounding up suspects. But communities where vigilante groups are active have suffered violent reprisals from Boko Haram.