The crew of a Danish cargo ship held by Somali pirates since early June have been released, Denmark's foreign ministry says.
Pirates target passenger and cargo vessels for ransom or loot
It said the pirates had turned the Danica White over to a French warship.
The Danish vessel was hijacked on 2 June off the Somali coast while heading for the Kenyan port of Mombasa to deliver a cargo of building materials.
The five crew members are undergoing a medical evaluation before being reunited with their families.
The Danish foreign ministry said the crew are in good condition, "although the hijacking has been a great strain".
Days after the Danica White was captured a US ship fired several warning shots across its bow and destroyed three boats the pirates had used in their attack and were towing behind the Danish vessel.
The US ship stopped its pursuit after the pirates navigated the Danica White into Somalia's territorial waters, where the US does not have jurisdiction.
It is not clear whether any ransom was paid for the crew's release. In July, Kenyan maritime officials said the pirates had demanded a $1.5 million (£750,000) ransom.
Somalia's waters are reported to be among the most dangerous in the world.
Somali pirates are trained fighters, and often use speedboats equipped with satellite phones and Global Positioning System technology.
They target passenger and cargo vessels for ransom or loot, and use the money to buy weapons.