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 said on Thursday.
"No Danish soldiers were injured, but five pirates were shot," the military said.
"Four of the pirates died. One was injured," it added.
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-defense and returned fire," the statement said.
After the shooting, the pirate ship sank and the eight pirates were brought aboard the frigate.
A piracy hotspot stretching 5,700 kilometers (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.
Danish Prime Minister Mette Frederiksen is currently in neighboring Ghana and due to visit the Esbern Snare.