Junior doctors and their employers have hammered out a deal in their long-running and bitter row over rosters.
The announcement came today after talks between the Resident Doctors' Association and district health boards.
The settlement still needs the approval of all 20 DHB chief executives, which is expected to happen on Thursday.
It also requires ratification by junior doctors, but their union said this would happen swiftly.
The deal guarantees safe working hours for doctors with no more than 10 consecutive days, down from 12, and fewer long nights in a row.
The union said it was achieved when DHBs allowed doctors to retain their existing right to veto roster changes by a two-thirds majority.
It said in return it agreed to clearer wording of the collective agreement, clarifying doctors' intentions to implement the affected rosters.
DHBs declined to comment until the deal was approved.
The Resident Doctors' Association has staged two strikes as part of the roster dispute: the first for two days in October last year and the second - a three-day strike - last month.
The dispute began more than a year ago.