Amongst the rows of dead bodies in Gwaska, in the Birnin Gwari area of Kaduna state, were children under the age of 10. Some bodies were mutilated.
Survivors say the attackers surrounded Gwaska on Saturday afternoon.
They set homes alight and fired shots, causing people to flee in panic - many straight towards the gunmen.
Residents have demanded that President Muhammadu Buhari's government urgently deploy more police and military to protect vulnerable villages on the state border with Zamfara.
Last month 14 miners were reportedly killed in an attack by gunmen in the Birnin Gwari area.
Gwaska residents say Saturday's attackers used to be cattle thieves but had turned to banditry in the region's remote villages.
The victims include members of a self-defence force, formed after attacks by well-armed cattle thieves.
More about: Nigeria