The Danes arrested 17 pirates, the Los Angeles Times reported. There were 18 hostages aboard the Somali ship, including the two who were killed.
Officials said they were investigating how the two hostages were killed. The report did not give the nationality of the hostages.
The Danes, under the command of NATO, had been patrolling off the Gulf of Aden putting pressure on Somali pirates.
A Danish navy statement said the warship Absalon had been shadowing a pirate ship for several days and moved to stop the vessel when it tried to head out to sea Sunday night, despite warning shots.
The Danes described the vessel as a pirate "mother ship" used as a base from which smaller, heavily armed speed boats attack ships.
Danish officials said there were plans to prosecute the pirates.
Campus cop fatally shoots Texas student during traffic stop
Police: Sword-wielding man demanded free tacos