A union for KiwiRail workers has withdrawn strike notices after getting a new offer from management.
The strike action slated for next week would have affected all rail operations, including the Auckland and Wellington metro systems, and the InterIslander ferries.
KiwiRail acting chief executive Todd Moyle said it had been a difficult negotiation with a good outcome.
"We have arrived at a settlement which provides our employees with a good pay outcome, and KiwiRail and our customers with a stable industrial environment into mid-2023," he said in a statement.
Rail and Maritime Transport Union General Secretary Wayne Butson said a new offer from KiwiRail will be taken back to union members for ratification.
"It has been tense at times, and we did not issue a strike notice lightly, but the outcome will be recognised by members as a fair one," he said in a statement.
Earlier, KiwiRail workers had said they were trying to secure an 8 percent pay rise.