(CNN) -- Somali pirates released a German cargo ship Saturday that they have held since May, the German Foreign Ministry said.
The MV Victoria was able to set sail on its own with all of its crew after being released, a ministry spokesman said.
It was not clear whether a ransom was paid.
Pirates hijacked the vessel May 5 as it was sailing to Jeddah, Saudi Arabia, with 10,000 tons of rice, Andrew Mwangura of the Seafarers' Assistance Program told CNN affiliate network ITN.
All the crew members are Romanian, he said.
The waters off Somalia are filled with danger as pirates continue to seize ships, despite increased measures by militaries and shipping companies to ward off their attacks.
Heavily armed pirates have been striking the busy Indian Ocean shipping lanes and Gulf of Aden, which connects the Red Sea to the Indian Ocean. They have captured dozens of vessels and hundreds of hostages, making off with millions of dollars in ransom.