Bandits on motorcycles killed 32 people and set fire to houses in several villages in the Kajura area of Nigeria's northern Kaduna state on Sunday, authorities said on Thursday.
Armed gangs are rife across Nigeria's northwest where they rob or kidnap for ransom, and violence has increasingly spread to other areas.
The attackers hit the villages of Dogon Noma, Ungwan Sarki and Ungwan Maikori, the statement from the state's ministry of internal security and home affairs said.
"An Air Force helicopter ... dispatched to the location, had earlier scanned the first two locations and sighted burnt houses and properties on fire," it added.
"The helicopter intercepted the bandits at the last location (Ungwan Maikori) and engaged them as they retreated, before the arrival of ground troops."
At the end of March, bandits blew up a train between the state's capital, Kaduna, and the national capital Abuja, killing eight passengers, injuring 26 and holding others for ransom.
(Reporting by Camillus Eboh in Abuja, Writing by Julia Payne, Editing by Andrew Heavens)