The Maritime Union has settled their long-running industrial dispute with Ports of Auckland this morning.
In a statement, union National President Garry Parsloe said a new collective employment agreement was passed in a unanimous vote at a stopwork meeting.
He said the new agreement was a positive step for workers at the port and should ensure the continued success of the port going forward.
The agreement would be signed off with the employer shortly, he said.
The dispute goes back to 2011. It centred on the ports of company seeking greater flexibility and productivity on the wharves and the union wanting a continuation of eight-hour shifts and job security.
A ports spokesman said: "We are pleased to have reached agreement with the Maritime Union and look forward to working with them to deliver even better results for the people of Auckland."
Mayor Len Brown, who was criticised by fellow members of the Labour Party for refusing to take the side of the workers, welcomed the settlement.
"Having agreement is good for Auckland, good for the Ports of Auckland and will provide much-needed certainty for the ports staff."