The Nigerian army has said an armed assault on a mosque in which 21 people died was the result of a criminal feud and not sectarian violence.
The attack on Sunday was the bloodiest in a day of violence which also saw the restive north-eastern city of Maiduguri rocked by a roadside blast and two separate gun attacks that killed at least four people including a local chief, according to residents and the military.
The army and locals said the pre-dawn raid on the mosque in the village of Dogon Dawa, in the northern state of Kaduna, was carried out by armed robbers engaged in a running feud with a local vigilante group.
Having been repelled by the community militia last week, the gang returned on Sunday, storming the mosque as people prepared for early morning prayers, killing some victims inside the building and some outside.
"We have 21 killed. Several others have been taken to the hospital with injuries," said Musa Illela of the National Emergency Management Agency in Kaduna.
Suicide bombings at three churches in June, claimed by Islamist group Boko Haram, had sparked reprisal violence by Christian mobs who killed dozens of their Muslim neighbours and burned some of their victims' bodies. Muslim groups also formed mobs and killed several Christians.
But military spokesperson Colonel Sani Usman told AFP that Sunday's shooting was "a clear case of armed robbery", and described it as a "revenge" attack linked to the rivalry between the thieves and the vigilantes.
Asked about a potential religious element in the shootings, he said only that "the victims were coming from prayers" at the mosque.
Village resident Dauda Maikudi told AFP that thieves regularly target the area as Dogon Dawa lies near a main road used by traders carrying goods and cash between the north and south of Africa's most populous country.
"It was a pre-dawn raid," he said. "The attackers... some of them dressed in police uniform, came into the village. They killed eight worshippers in the mosque and killed 13 other residents in the village."
"We believe they were armed robbers because this area has been bedevilled by armed robbers for years," he added.
Dogon Dawa lies about 70km from the state capital Kaduna city.
It was also unclear who was responsible for the bloodshed in Maiduguri.
A resident and doctor at a local hospital reported that gunmen there shot dead a married couple and their child as the family left church in Maiduguri's Gwange area.
A resident of the area, Bukar Kolo, told AFP that the gunmen fled after the attack outside the Church of Christ in Nigeria building.
Nation of unknown gunmen
In a separate incident, the traditional chief in Gwange, Mala Kaka, who has close ties to the area's top Islamic leader, was gunned down in his home, according to his guards and residents.
Kaka was close to the Shehu of Borno state, Umar Garbai el-Kanemi, a key cleric who Boko Haram tried to assassinate in July in a suicide blast in Maiduguri that killed five others but left Kanemi unharmed.
The radical Boko Haram Islamists have vowed to kill many of Nigeria's traditional Muslim leaders, who they accuse of betraying Islam by submitting to the authority of a secular government.
Boko Haram have also repeatedly attacked Christians attending Sunday worship across northern Nigeria, but there was no indication as to why the slain family may have been specifically targeted.
Commenting on the latest violence, Kaduna-based rights activist Shehu Sani said Nigeria had "become a nation of unknown gunmen and absentee leaders".
Nigeria, Africa's top oil producer, is roughly divided between a mainly north and mostly Christian south.