The ship had been held by the Maritime and Coastguard Agency after P&O sacked 800 of its workers.