A German cargo ship held captive for 41 days off the coast of Somalia was released and all aboard were safe and unharmed, a shipping company said Wednesday. A Somali official said the pirates received a large ransom. The Lehmann GmbH shipping company said the MV Lehmann Timber was sailing for a safe port a day after the ship was freed. The captain and 15 crew members will be brought ashore and given medical checkups and allowed to rest, it said in a statement. "The ship and its 15 crew members were released on Tuesday afternoon after pirates received a ransom of US$750,000," Ali Farah Warfa, the acting district commissioner of the Somali coastal town of Eyl, told The Associated Press by telephone. He said the ransom came in by another ship and was paid to 18 pirates, most armed with AK-47s and heavy machine guns, in Eyl, a town 500 kilometers north of Mogadishu.