The Belgian government has secured the release of a crew held captive for 10 weeks on the Somali coast, by delivering a ransom to pirates at sea.

The government said the Pompei dredger's 10-member crew was in good health and would be flown home within a few days.

Defence Minister Pieter De Crem said the government had paid a ransom, though he would not disclose the exact amount.

The pirates had asked for $8 million to release the ship that had held two Belgians, three Filipinos and four Croatians prisoner since April 18.

De Crem said the money was dropped into the sea near the stranded ship on Saturday, which led to some 10 pirates abandoning their position on the ship early Sunday.

The government considered taking military action to retrieve the ship and its crew, De Crem said, but eventually decided that option was "not desirable" because it could endanger the hostages.

Negotiations had involved a middleman, who was occasionally able to provide messages from the captain to Belgian officials.

The Pompei crew is only one of many victims of piracy, a criminal enterprise that has thrived in and around Somalia's coastline since that country's government fell nearly 20 years ago.

Most recently, pirate activity has declined in the region because of seasonal monsoons.

Belgian police say they intend to sweep the Pompei for forensic and DNA evidence when it reaches harbour, with hopes of one day tracking down the pirates who were involved.

"We think there is a chance" that some of the pirates might be caught and brought to justice, Johan Delmulle, a Belgian federal prosecutor, told reporters Sunday.

With files from The Associated Press