The Marida Marguerite, with a crew of 19 Indians, two Bangladeshis and one Ukrainian, was seized in May by pirates armed with rocket-propelled grenades.
Kenya-based officials said a ransom was paid, but there was no independent confirmation.
Pirates now hold 25 vessels and 587 hostages after they seized another German-owned ship on Monday.
The EU’s Indian Ocean anti-piracy force (Navfor) said in a statement that the cargo ship Ems River was taken in the early hours, about 200 miles (325km) north-east of the port of Salalah in Oman.
The ship was on its way to Greece from Dubai at the time of the attack, carrying a cargo of petroleum coke.
The EU said it had an eight-strong crew of one Romanian and seven Filipinos.
One Tuesday afternoon, the Marida Marguerite was sailing to safe waters, according to Andrew Mwangura, head of the Kenya-based East African Seafarers’ Assistance Programme.
He said $5.5m was paid to release the ship. The vessel’s owners have not yet commented.
Officials and companies rarely comment on the payment of ransoms, though analysts say such deals are widespread – BBC