Spokesperson Jack Nwachukwu Nwaogbo told journalists in the city of Maiduguri that a 13-year-old boy, five men and 11 suspected members of a radical sect locally known as Boko Haram were killed during the operation on Saturday evening.
He declined to comment on how they died.
Usman Abdullahi, the 36-year-old brother of a victim, said soldiers chased people in the streets for hours and shot at them. He said soldiers accused them of being sect members.
Nwaogbo said security forces launched a search operation after two suspected members threw two homemade bombs at patrol cars from a moving bus. He said the blasts injured five soldiers.
An activist group, the Civil Rights Congress of Nigeria, said in a statement on Sunday that the war against Boko Haram “must be done within the ambit of the law and constitution”.