United Nations officials in Somalia say a cargo ship held for nearly 100 days at sea by pirates has finally arrived in port .