A European Union naval spokesman says Somali pirates have released a German vessel after a ransom was paid.

British Royal Navy Cmdr John Harbour says the ship, which had been held nearly four months, was released after the ransom was paid around lunchtime.

He said by telephone Monday evening: "The Hansa Stavanger was released within the last two hours by the pirates who left the ship."

"She put to sea on her own steam and she is continuing out to sea under the protection of European naval force units."

He was reached at the headquarters of the EU's anti-piracy mission in Northwood, near London.

He says EU forces had not yet boarded the vessel but that "the positive news is we have not heard of any casualties."

He had no further details.