The riot prompted residents in the Northeast city of Maiduguri to lay siege to the camp, wielding swords, daggers and clubs, and threatening to kill anyone who left the facility, security sources said.
The incident illustrated the sensitive task which authorities face in re-inserting former fighters back into communities that have often suffered from years of attacks and kidnappings during a 12-year Islamist insurgency.
The army presents the surrender of hundreds of Boko Haram fighters and families in recent months as a sign of success in ending the conflict centred in northeast Borno State, but many residents still see them as a security risk.
Around 250 Boko Haram members, including women and children, staged a violent protest in the Gidan Taki outskirts of the city, smashing windows and doors and threatening to move out of the camp if their demand was not met, the sources and residents said.
“The Boko Haram inmates went on a rampage this morning, breaking doors and windows and even attempted to leave the camp,” said Konto Garga, a member of an anti-jihadist militia that helps the army.
According to the Nigerian military, 18,000 Boko Haram fighters and their families have surrendered to the army following the death in May of their leader Abubakar Shekau.
Shekau blew himself up to avoid capture during infighting with the rival Islamic State West Africa Province (ISWAP) faction in his Sambisa Forest enclave.
ISWAP split from Boko Haram in 2016 to become a dominant group in Nigeria with ties to the so-called Islamic State.
Many Maiduguri residents fear jihadists are surrendering not out of remorse, but in desperation to escape ISWAP rivals who were executing Boko Haram militants for refusing to yield to the group.
The protesting terrorists, who have been in the camp since August, were demanding authorities hand them the cow they are provided daily to slaughter themselves instead of being provided with the beef from the abattoir, the sources said.
“People living in the area came out with locally made weapons and vowed to kill any one of the protesters who stepped out of the camp,” militia member Garga said.
“The people still see them as a security threat,” said Garga, who was among security personnel sent to prevent the jihadists from leaving.
Gidan Taki resident Usman Bunu said people in the area do not believe the surrenders are sincere and the protest only confirmed their suspicions.
“They still consider anyone not in their fold as an infidel, which is why they want to be allowed to slaughter their cow themselves,” Bunu said.
“Had they come out of the camp we would not have hesitated in finishing them all because we know how dangerous they are,” he said.
The threat by the armed residents and reinforcement of security personnel ended the riot and the inmates returned to their quarters, Bunu said.
The riot was the second in the camp, with a similar one over the same demand in September, militia leader Babakura Kolo said.
The Boko Haram inmates have been unruly since they arrived in the camp, constantly quarrelling with his men guarding the camp, and accusing them of looking at their wives, Kolo said.
“They still have Boko Haram mentality and openly insult our men as agents of the infidel government,” Kolo said.