DAKAR, Senegal — For six days, the parents kept a vigil at the school in northwestern Nigeria where their boys, more than 300 of them, were taken by armed men in the night.
The gunmen’s raid on their city, Kankara, was an agonizing replay of the 2014 abduction of 276 schoolgirls in Chibok by the Islamic extremist group Boko Haram. That group claimed to be holding their sons, too, and the families were painfully aware that 100 of the Chibok girls were still unaccounted for years later.
The families gathered at Government Science Secondary School, praying and fearing the worst.
“We don’t know if he has eaten, if he’s sick, dead or alive,” said Abdulkadir Musbau, whose son Abdullahi was among the abducted.
But just as suddenly as the families’ ordeal began, it seemed to be ending, and with the best possible news: Late Thursday night, the governor of their state announced that all of the abducted boys had been released, and would be reunited with their parents the next day.
It was unclear under what terms the boys’ freedom had been secured. The governor, Aminu Bello Masari, told a Deutsche Welle television reporter that the government had not paid ransom, and that negotiations were with a group of men he described as “bandits” rather than with Boko Haram.
Boko Haram had claimed the abductions from the start, but the degree of the group’s involvement was murky. Kankara is in northwestern Nigeria, where the group had not been known to operate. Among terrorist experts, that raised the possibility that the group was seeking to expand by making common cause with militant and criminal groups already established in the region.
The group seemed to confirm that idea when it released a video showing some of the abducted boys. One boy who said he was from Kankara is shown begging the government to call off the army, dissolve vigilante groups and close schools. “We have been caught by a gang of Abu Shekau,” he said, referring to the head of Boko Haram. “Some of us were killed.”
“You have to send them the money,” he added.
Crowding around him, a dozen smaller boys added their voices. “Help us,” they called out to the camera.
An audio message from a Boko Haram representative was tacked onto the end, implying some sort of collaboration between the kidnappers and the Islamic militants.
In a BBC interview recorded before news of the release, Mr. Masari said the kidnappers had made contact with the father of one of the boys, demanding that the government send them money.
“We have an idea where they are, but we are trying to make sure there is no collateral damage, that the children are brought back safely,” he said. “So that’s why we are treading carefully and softly.”
President Muhammadu Buhari won election in 2015 vowing to clamp down on Boko Haram and other militant and bandit groups in northern Nigeria. And he has repeatedly promised to bring home every Chibok student.
“The Chibok girls are still fresh in our minds,” said Bulama Bukarti, an expert on extremist groups in Africa at the Tony Blair Institute for Global Change. “The difference is now Boko Haram has fighters outside the northeast, they have people who are natives of the northwest.”
The kidnappings share striking similarities. Like the Chibok attack, armed men rushed the boarding school at night, taking hundreds of children, in this case all boys, and moving them to a countryside hide-out. They were then split up into groups, according to students interviewed by local media outlets who managed to escape their abductors, making it more difficult for security forces to conduct a rescue operation.
Mr. Musbau said he was out buying noodles for his children’s Saturday breakfast when heavy gunfire erupted. Around him, people started running in all directions, so he sprinted home, passing police and vigilantes on the way.
Hearing that their children’s boarding school had been the focus of the attack, he and other parents raced there at dawn.
When he got to the school, “I saw his bed, neatly made, and his box and hat on top of it,” Mr. Musbau said. “But not him.”
Mr. Musbau had been delighted when Abdullahi, the eldest of his six children, earned a spot at the government science school. In elementary school, he had finished at the top of his class, and hoped to be a doctor when he got older.
“The reality dawned on us that our children were indeed abducted,” he said in a telephone interview from the school, which he had barely left since the attack. “Everyone was hysterical. No one thought that the bandits could do this. They have never done such a thing.”
The attack in Kankara was the third mass kidnapping from a Nigerian school in six years: In 2018 more than 100 girls were kidnapped in the rural community of Dapchi, a town in the northeast, though most of them were returned home after a few days.
The kidnapping was significant both because it occurred outside Boko Haram’s known sphere of influence and also because it took place in the president’s home state, Katsina, just as he had arrived for a weeklong visit.
Mr. Buhari released a statement late Thursday night hailing the return of the kidnapped students, and praising the cooperation of the security forces and the government of Katsina and Zamfara states.
In the statement, Mr. Buhari urged patience with his administration as it tried to deal with security disruptions around the country, and reiterated his promise to work for the release of other detainees.
Many northern Nigerians voted for Mr. Buhari in 2015 thinking that he would use his credentials as a former general and one-time dictator to instill discipline and build peace in Africa’s most populous nation.
But despite the government’s claims, Boko Haram and other militant groups still pose a potent threat. And these latest attacks, coming on the heels of a countrywide uprising against police violence, insecurity and bad governance, have exposed the public’s growing discontent with a Nigerian government unable to protect its people.
In the northeast, the government has pursued a strategy of building heavily protected garrison towns, leaving the countryside largely at the mercy of the militants. More than 70 farmers were killed there last month, caught between the government and the extremists.
In Kankara, a local official said the government was aware of the deteriorating situation but had done nothing to resolve it.
“These bandits are very well known, and so are their families,” said the official, who asked for anonymity because he had been instructed not to speak to journalists. “Why were they treated with kid gloves until they became monstrous and difficult to contain?”