Sources told Reuters that bandits rustled cattle in the Zamfara community of Gidan Dan Inna and villages around the town of Auki in the Bungundu local government area before being pursued by local vigilantes.
"The vigilantes didn't know that the bandits had laid an ambush for them ... they opened fire on the vigilantes while riding into the bush on motorbikes, killing about 30 of the vigilantes," one of the sources said.
These "bandits" are rife across Nigeria's northwest where they rob or kidnap for ransom, including from schools. Thousands of people have been killed in bandit attacks in recent years.
Nigeria's military has tried to stamp out the gangs and launched air strikes on bandits groups in January.
A local government official from the area who lives in the state capital, Gusau, confirmed the incident on condition of anonymity.
"It is a painful, double loss to us," he said.