The rail line north of Auckland between Swanson and Whangārei will receive funding worth more than $94 million to "bring it out of decline".
The $98.4 million from the Provincial Growth Fund (PGF) is the first chunk of funding from the $300 million allocated to the PGF in Budget 2019 for investment in regional rail.
State Owned Enterprises Minister and NZ First leader Winston Peters said without the multimillion-dollar investment in the Northland rail line, it would become unsafe to use.
- KiwiRail 'back on track': How $1 billion boost will be spent
- Budget 2019: How the Government's divided up its funding
- Government scraps National's plan for KiwiRail diesel trains
"Without our investment, this rail line to Whangārei will become unsafe and have to close within five years - leaving Northland cut off from rail services most other regions have," Peters said on Friday.
"That's unacceptable and unfair to the people of Northland. That's why the Government is addressing decades of under-investment and neglect in the rail line, to support the future growth of rail in Northland."
The funding announcement follows the $1 billion boost given to KiwiRail in Budget 2019, part of which will replace old train engines and container wagons.
The Northland funding will see about 54km of the 181km track replaced or upgraded, as well as tens of thousands of sleepers replaced, and tens of thousands of cubic metres of ballast - a material used to provide stability to a vehicle - added.
Ageing bridges will also be replaced, and overdue maintenance work on tunnels will be carried out, in addition to ditches being cleared and embankments stabilised.
Regional Economic Minister and NZ First MP Shane Jones said the funding will help improve freight services on the line and have direct benefits for Northland's economy.
"Not only does it set the right conditions for KiwiRail to grow its freight business, wherever possible KiwiRail will be using Northland based contractors to carry out work," Jones said.
"It will look to Northland first if they recruit more track staff, as well as sourcing materials in Northland."
KiwiRail chief executive Greg Millar said the improvements will cut down train travel times and make the line more resilient to weather events.
"It gives more certainty for our customers and will make rail an option for Northland businesses and exporters to get their goods to market."
He said 95 percent of freight in Northland is currently moved by road, so the improvements to the line are the "foundation for addressing that imbalance".
- $53.1 million will be spent on track, sleepers and ballast
- $16.2 million will be spent on replacing five of the 88 bridges on the line
- $7.3 million will be spent on repairs to 13 tunnels
- $9.5 million will be spent on clearing drains and pipes under the tracks
- $4.7 million will be spent on stabilising the slopes on nine embankments
- $800,000 will be spent on vegetation control along the rail line
- $3.2 million will be spent on reviewing and improving the Whangārei Rail Yard