The New Brunswick government will provide $25 million to Canadian National Railway to upgrade its rail line and keep freight service in northern New Brunswick.

The money will be used to improve the rail infrastructure. In return, CN agrees to spend a comparable amount to maintain and operate the line and continue rail freight service for a 15-year period on the northern and southern sections of the line.

Newcastle subdivision

Map shows the two sections of the Newcastle subdivision line that will continue operating. (Marc Genuist / CBC)

However, a 70-kilometre section of the Newcastle subdivision between Nelson Junction and Nepisquit Junction is not included in the agreement "due to the significant investments required to maintain the line and the lack of both originating and terminating freight traffic on that section," the government stated in a new release.

CN will seek to discontinue rail operations on that section, which means there will not be a direct connection on the line between the Bathurst and Moncton areas.

The government money will be used to improve the sections of the subdivision between Irvco and Nepisquit Junction in the north and between Catamount and Nelson Junction in the south. There are active freight customers on both those sections of the subdivision.

Work on the rail line improvements is to begin this spring.

"Freight rail is a critical mode of transportation for industries in northern New Brunswick, and it is a vital lifeline for the jobs and communities that rely on those industries," said Premier David Alward at a news conference in Miramichi on Friday morning.

"Our investment in the rehabilitation of two sections of railway line ensures companies in northern New Brunswick can continue to ship their goods to market efficiently and explore new opportunities for growth."

Premier David Alward making CN funding announcement in Miramichi

Premier David Alward made the CN funding announcement in Miramichi on Friday. (Marc Genuist/CBC)

In August 2012, CN announced it needed $50 million from government and other partners to upgrade the line, or it would discontinue part of the Newcastle Subdivision service by March 2014.

"We thank the provincial government for working with us over the last year to develop this agreement that will preserve rail freight service in northern New Brunswick," said Sean Finn, CN's executive vice-president for corporate affairs.

"This agreement would not have been possible without the commitment of both parties to continuing investments and to the growth of rail freight traffic in the region."

The company had said it was incurring annual losses due to declining traffic volumes and infrastructure costs on the line. The 224-kilometre Newcastle Subdivision runs from Catamount, just west of Moncton, to Irvco, which is about 32 kilometres west of Bathurst.

Before the section of line between Nelson Junction and Nepisquit Junction can be discontinued, it will be offered for sale in early February to private interests, and then municipal, provincial and federal levels of government. There will be a five-month window for offers to purchase the middle section.