Gunmen killed 14 nomadic herders in an attack on a village in the north eastern state of Borno, local government representative Alhaji Garba Ali told reporters.
At least 24 members of a vigilante group were killed in a separate attack in a forest in the same state, said another local official who asked not to be named.
The attackers were wearing military uniforms and the vigilantes followed them into the forest, believing them to be government soldiers, the official said.
The military has encouraged the formation of vigilante groups to help it track down Boko Haram members as it pursues an offensive in the northeast aiming to end the Islamist extremists' four-year insurgency.
More From This Section
Nigerian President Goodluck Jonathan declared a state of emergency in the northeast in May and the military immediately launched a major offensive in the region aiming to end Boko Haram's insurgency.
Boko Haram's insurgency has left more than 3,600 dead since 2009, including killings by the security forces, who have been accused of major abuses.