Attackers beheaded five people after storming into their homes on Wednesday in the Nigerian city of Maiduguri, the base of an insurgency by Islamist extremist group Boko Haram, residents said.
"I saw the five decapitated bodies before they were taken away by soldiers from the (military task force)," one resident told AFP of the attack in the northeastern city.
A military spokesperson said in a statement that three people were killed by suspected gunmen, but the army often underplays casualty figures and details of attacks amid heavy pressure to show progress in the fight against Boko Haram.
Several residents spoke of the beheadings, saying the attackers arrived at around 3am, first killing a man and his son in one house, then two other residents in a second house, followed by the fifth victim in a third house.
Residents said the fifth victim was a fisheries official in the ministry of agriculture.
There was no immediate claim of responsibility for the attack.
The military said it had "cordoned off the area, arrested three suspects and recovered one assault rifle with 10 rounds of ammunition".
"Two gunmen lost their lives and a soldier was wounded during an exchange of fire," it said. "The suspects are in (military) custody and efforts are on to apprehend the fleeing members of the gang."
Violence linked to Boko Haram's insurgency has left some 3000 people dead since 2009, including killings by the security forces.
Attackers have previously slit the throats of victims and there have also been unconfirmed claims of beheadings. Most of the killings blamed on Boko Haram have however involved bombings and shootings.
Nigeria has seen an uptick in violence since it sent an initial contingent of 190 troops to Mali last week, including two Mali-bound soldiers killed in a bomb attack on Saturday in the centre of the country.
A group calling itself Ansaru claimed responsibility for the attack on the soldiers and said it was in response to the situation in Mali.
It is not clear if the other recent attacks were linked to the Mali crisis.
Also on Saturday, gunmen opened fire on the convoy of the emir of Kano, an influential Nigerian Muslim figure, killing five people. The 82-year-old emir Ado Bayero was not hurt, but two of his sons were wounded.
Gunmen believed to be from Boko Haram on Monday killed 18 people when they opened fire at a market in Damboa, located near Maiduguri.
Nigeria is Africa's most populous nation and largest oil producer, roughly divided between a mainly Muslim north and predominately Christian south.
Boko Haram has claimed to be fighting for the creation of an Islamic state, but its demands have repeatedly shifted and it is believed to include various factions. Criminal gangs and imitators are also suspected of carrying out violence under the guise of the group.