Canadian National Railway Co. has signed a deal to buy the Athabasca Northern Railway Ltd., a key railway link to the oilsands region of northern Alberta.

CN said Monday it will pay $25 million for the railway and will invest $135 million in upgrades over three years to improve transit times and service consistency.

"CN's investment and partnership agreements with key shippers will allow the parties to maintain important rail service to Lynton, Alta., a point near Fort McMurray, home of existing and future oil sands development," CEO Hunter Harrison said in a statement.

"While Athabasca Northern's current traffic volumes are too low to keep it going as a stand-alone operation, we and our shipper partners see the Athabasca Northern playing a critical role in one of the world's largest construction projects."

The purchase and upgrade plans are premised on long-term traffic volume guarantees that the company has negotiated with Suncor Energy Inc., OPTI Canada Inc. and Nexen Inc., the company said.

"Suncor has a long history with the Athabasca Northern and, with this announcement, we're looking forward to the line's future with upgraded operations," says Mike Ashar, Suncor executive vice-president.

The 325-kilometre Athabasca Northern connects with CN at Boyle, Alta., about 160 kilometres north of Edmonton.

CN said it plans upgraded rail, ties, bridges and new ballast to allow greater volumes of northbound shipments of construction materials and machinery to support oilsands development.