The kidnap of 344 schoolboys in northwest Nigeria had the appearance of an Islamist militant attack, much like the Boko Haram kidnapping of 270 schoolgirls in 2014.
But government and security officials now say the attack was a result of inter-communal feuding over cattle theft, grazing rights and water access - not spreading extremism.
Officials in Katsina state and neighbouring Zamfara, where the boys were released after six days, said the attack was carried out by a gang of mostly semi-nomadic ethnic Fulanis, including former herders who turned to crime after losing their cows to cattle rustlers.
"They have local conflicts that they want to be settled, and they decided to use this (kidnapping) as a bargaining tool," said Ibrahim Ahmad, a security adviser to the Katsina state government, who took part in the negotiations through intermediaries.
Cattle herders in the northwest are mainly Fulani, whereas farmers are mostly Hausa. For years, farmers have complained of herders letting their cows stray on to their land to graze, while herdsmen have complained their cows are being stolen.
Dozens of gunmen arrived on motorcycles at the Government Science Secondary School on December 11 in the town of Kankara in Katsina. They marched the boys into a vast forest that extends from Katsina into Zamfara.
The intermediaries met the kidnappers in Ruga forest on several occasions before they agreed to release the boys, according to Zamfara Governor Bello Matawalle and security sources including Ahmad.
The gang accused vigilante groups, set up to defend farming communities against banditry, of killing Fulani herders and stealing their cows, Matawalle and Ahmad said. They also made similar accusations against members of a Katsina state committee set up to investigate cattle theft, Ahmad added.
He said he was not aware of any such incidents, but said a police investigation had been launched. No ransom was paid for the boys' release, according to officials in both states.
Gangs such as these have carried out attacks across the northwest, making it hard for locals to farm, travel or tap rich mineral deposits in some states. They were responsible for more than 1,100 deaths in the first half of 2020 alone, according to rights group Amnesty International.
Boko Haram, based in the northeast, has sought to forge alliances with some of them and released videos this year claiming to have received pledges of allegiance, said Jacob Zenn, a Nigeria expert at the US-based Jamestown Foundation think tank.
A man identifying himself as Boko Haram leader Abubakar Shekau claimed responsibility for the schoolboys' kidnappings in an unverified audio recording. Soon after, the video started circulating on social media.
Nigerian Information Minister Lai Mohammed dismissed Boko Haram's claim at a December 18 news conference, saying: "They just want to claim that they are still a potent force.
"The boys were abducted by bandits, not Boko Haram," Mohammed said.
The day after the boys were returned to their families in Kankara and other towns, another gang briefly abducted some 80 students who were returning from a trip organised by an Islamic school.
The kidnappers released the children after a gunfight with police and a local vigilante group, state police said.