Staff at Wellington's CentrePort have been ordered to unload a ship they had blacklisted after it was loaded by non-union workers in Auckland.
The Employment Court has granted an injunction against the Maritime Union and the Rail and Maritime Transport Union.
That means both unions are prevented from stopping their members working on the Maersk Aberdeen.
The ship has spent four days sitting fully loaded in Wellington while workers went out in sympathy.
But the Maritime Union said the workers are not doing anything unlawful because they are not actually striking.