Nigerian soldiers torched more than 20 homes in a community in the oil-rich Niger Delta after "suspected pirates" killed six people, security sources and residents said on Tuesday.
Gunmen on Sunday attacked a gunboat escorting a vessel in the volatile waters off the Nigerian coast, a Nigerian security source told AFP.
"During the ensuing gun battle, four of the soldiers and two civilians on board the vessel were killed," the source said.
Security forces launched a manhunt for the assailants focused on the nearby community of Lutugbene in the wake of the attack.
"Soldiers stationed at the Beneside Flow station on Monday afternoon invaded Lutugbene community claiming to be on the manhunt for suspected sea pirates that attacked their boat," community leader Austin Ozobo told AFP.
"The soldiers ended up burning a minimum of 21 houses."
The security source confirmed the village was targeted but said military personnel "torched houses owned by persons who are sea pirates".
Nigeria's Delta region has long been a hotbed of piracy with armed criminal gangs striking at ships from their hideouts among myriad onshore creeks.
The area is home to most of the country's vast oil reserves but despite decades of production, oil wealth has failed to trickle down to local communities.
The waters of the Gulf of Guinea are some of the most pirate-infested in the world according to maritime security experts.