Seven of the assailants were neutralised by security agents.
Fleeing gang members killed nine people and burnt down six houses.
At least 40 people were killed and many others wounded in an attack by gunmen on Zurak village in Nigeria's north-central Plateau state, where clashes between herders and farmers are rife, the police and residents said on Tuesday.
Plateau police spokesperson Alfred Alabo said armed men, often referred to locally as bandits, fleeing an "aggressive onslaught" by security agents in Bangalala forest of Wase local government area of the state attacked Zurak and Dakai villages late on Monday.