Islamic State-aligned jihadists held 76 farmers for two days in northeast Nigeria's Borno state near the border with Cameroon, militia sources said Tuesday.
The Islamic State West Africa Province (ISWAP) fighters kidnapped the farmers from a displaced people's camp in Ngala on Friday while they were burning thick vegetation to make a clearing for their harvest, the sources said.
The men, women and children were taken to a camp in the nearby town of Chikongudo under ISWAP control where they were kept until Sunday, the militia sources said.
"ISWAP had warned farmers from burning shrubs and thicket in the area which give them cover from Nigerian troops," militia leader Umar Kachalla told AFP.
They were released after the men were flogged "as punishment and warning", he said.
His account was corroborated by Umar Ari, another militia leader.
"They were lucky to have been taken by ISWAP and not Boko Haram who would have killed the men and enslaved the women and the children," Ari said.
ISWAP a rival of Boko Haram, from which it split in 2016 because of disagreements over the indiscriminate targeting of Muslim civilians and use of children and women as suicide bombers.
Both have increasingly targeted loggers, farmers and herders, accusing them of spying and passing information to the military and the local militia fighting them.
They also raid herding communities, seizing cattle to raise money for their operations.
The jihadist violence has killed some 40,000 and displaced around two million from their homes in the northeast since 2009.
Most of the displaced rely on food handouts from aid agencies while others have turned to felling trees in the arid region for firewood which they sell to buy food.
In December last year, Boko Haram jihadists killed more than 70 rice farmers in their fields outside the regional capital Maiduguri, accusing them of cooperating with Nigerian troops.
Days later, they seized around 40 loggers and killed three others in a forest outside Gamboru.
In November 2018, Boko Haram jihadists abducted around 50 loggers at Bulakesa village near Gamboru.
The violence has spread to neighbouring Niger, Chad and Cameroon, prompting a regional military coalition to fight the insurgents.