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.