Locked-out wharfies at Ports of Auckland will be back at work by the end of next week.
The port company has lifted its lock-out notice and has agreed to return to mediation.
Ports of Auckland has agreed to pay the wharfies until Thursday next week, and will allow them back on the job by no later than next Friday.
The parties will return to mediation.
The out-of-court settlement between the port company and the Maritime Union was announced on Friday afternoon during a hearing at the Employment Court in Auckland.
Ports of Auckland chief executive Tony Gibson says the company agreed to the settlement to get goods moving again.
But he says the company is right to contract out in a new collective agreement and it remains its bottom line.
Mr Gibson says the company will return to the bargaining table with a fresh determination, and get the collective agreement the port needs to operate competitively.
Maritime Union president Garry Parsloe told Checkpoint he was very pleased at the decision.
He says union members can now get back on the job and the damage done to families can be repaired.
He says it would now be possible to get everyone up and running and get a collective done that we can all live with and we can all go forward and turn this port into a productive port again.
Meanwhile, a director of Ports of Auckland has resigned citing differences with the company.
Rob Campbell has been a director since 2010.
Mr Campbell says he has formed the opinion his position as a board member is untenable, given the strong difference of view he has with the company's position and strategy.
He is refusing to make any further comment.
Mr Campbell is a director of a number of companies and has a union background.