Two hostages were killed by Somali pirates during a rescue operation off of the coast of the Horn of Africa on Tuesday.

The unidentified hostages were mortally injured during an anti-piracy raid after a Danish Navy vessel confronted the pirates off the Somali coast.

The Danish warship Absalon stopped a pirate mother-ship on February 27, 2012. During the operation, two hostages were killed, the Navy said in a statement.

Part of a NATO-led push to stop piracy in the Gulf of Aden, the Danish Navy opened fire when the pirate ship refused to stop. The pirates surrendered and the Danes found a total of 17 suspected pirates and 18 hostages on board, according to The Associated Press. The nationalities of the hostages are unknown.

Two hostages were found seriously injured, but despite swift assistance from Absalon's doctor, their lives could not be saved, the Navy said.

The warship had been following the pirate ship for several days. Overnight Sunday to Monday, when the pirates tried to leave the coast, Absalon intervened and stopped the mother ship, before it could pose a threat to shipping in the open sea, the Navy added.

According to the United Nations, there are 3,500 Somali pirate ships in the Gulf of Aden and the Indian Ocean, including the region where the stranded Costa Allegra cruise ship is currently being towed.

There were 237 attacks in the area in 2011, and a total of $160 million was paid for the release of hijacked shipping vessels. Additionally, piracy costs the shipping industry and governments billions of dollars a year in lost cargo, ransoms, increased fuel and military operations, Bloomberg reported.

The pirate mother ship was used as a base for a number of pirate attacks in the region, the Danish Navy said.