Pirates have targeted the MV Almezaan several times in the past year
A suspected pirate has been shot dead as private guards repelled an attack on a cargo ship off Somalia, in what may have been the first such incident.
Guards aboard the Panamanian-flagged MV Almezaan returned fire after the ship was attacked - the third time in a year that pirates had targeted the ship.
The EU naval force (Navfor) said a team from an EU warship found the dead man after responding to a distress call.
Six other suspected pirates were detained by a Spanish Navfor ship.
The ESPS Navarra found one pirate mother ship and two skiffs. The mother ship was destroyed after the suspects were taken into custody, Navfor said.
Navfor spokesman Cmdr John Harbour told the BBC News website that he believed there was strong evidence to prosecute the six suspects detained.
"All the evidence suggests that there was a fire-fight," he said.
Bullet-holes were found in the skiffs in which they were found, he added.
The owners of the cargo ship, which was en route to Mogadishu, were contacted and asked to comply with any subsequent prosecution, Cmdr Harbour said.
The waters off Somalia are among the most dangerous in the world for shipping, despite patrols from Navfor and other foreign naval forces.
The Navarra received a distress signal early on Tuesday from a merchant ship off the Somali coast and sped to the area, Navfor said in a statement.
The Spanish frigate ESPS Navarra investigated the incident
Pirates had launched an attack on the MV Almezaan. This was successfully repelled by members of an "armed private vessel protection detachment" on board the ship, who returned fire.
A second attack was also repelled and the pirates fled the area, Navfor said.
A helicopter from the Navarra sighted the suspected pirates' boats and ordered them to stop, firing warning shots when they refused to do so.
When a team from the Navarra boarded the vessels, they found three suspected pirates in one skiff and three in the second, along with the body of a fourth man.
The body was transferred to the Navarra and an investigation indicated that the individual had died from small-calibre gunshot wounds, Navfor said.
A number of suspected Somali pirates have been killed by international forces during rescue operations but this is thought to be the first time private security guards have killed a pirate in defence of a ship.
Pirates are known to use fire-arms and rocket-propelled grenades in their attacks on ships but rarely harm the crews of vessels they capture.
Several organisations, including the International Maritime Bureau (IMB), have expressed concern that the use of armed security contractors could encourage pirates to be more violent when taking a ship.
Somalia has not had a functioning government for nearly two decades and analysts believe that attacks on shipping will continue as long as there is no central government capable of taking on the pirate gangs.