Frigate Esbern Snare spotted the suspected pirate ship near several commercial ships, says Danish military.
A Danish naval patrol killed four pirates in an exchange of fire in the Gulf of Guinea off the coast of Nigeria, Denmark’s armed forces say.
“No Danish soldiers were injured, but five pirates were shot,” the military said on Thursday.
“Four of the pirates died. One was injured,” it added.
The incident happened outside Nigeria’s territorial waters, a spokesman said.
The incident occurred on Wednesday when the frigate Esbern Snare, which has been patrolling the area since early November, attempted to board the pirate boat.
The Danish forces fired warning shots, and the pirates immediately fired back.
“The Danish soldiers acted in self-defence and returned fire,” the statement said.
It was the first time the frigate opened fire during the current mission to the Gulf of Guinea, the spokesman said.
The remaining four pirates were taken on board the frigate, the military said. After the shooting, the pirate ship sank.
A piracy hotspot stretching 5,700 km (3,540 miles), from Senegal to Angola, the Gulf of Guinea saw 195 attacks in 2020.
The same year, 130 of 135 hostage-takings at sea occurred in the region, according to the International Maritime Office.
The Danish helicopter-equipped frigate and its 175 sailors “are fulfilling an important task by protecting Danish and other commercial vessels in the region”, Defence Minister Trine Bramsen told news agency Ritzau.
Copenhagen in March announced it was sending the vessel to patrol the zone, where some 40 Danish ships operate daily.
Denmark’s Prime Minister Mette Frederiksen and main opposition lawmaker Jakob Elleman had both planned to visit the frigate during a visit to Ghana on Wednesday and Thursday.
Danish tabloid Ekstra Bladet reported on Thursday they had not been on board the frigate during the incident.
The frigate will operate in the gulf until April next year.