BNSF Railway said Wednesday it will reduce its capital spending in Minnesota this year by 60 percent, part of a reduction nationwide that reflects softening demand for freight service.

The company, owned by Warren Buffett's Berkshire Hathaway Inc., said it expects to spend $130 million this year on maintenance and rail upgrades in the state. BNSF intends to carry out more than 360 miles of track surfacing and undercutting work, replace roughly 70 miles of rail and about 375,000 ties, as well as upgrade signals.

A spokeswoman for the railroad said the lower amount stems in part from fewer projects in the state after heavy spending and work in recent years. She also said demand "has softened" among BNSF's energy, steel and agriculture customers.

BNSF spent $326 million last year in Minnesota and $550 million in the state over the last three years. That spending was partly a reaction to tie-ups that happened in 2014, when snowstorms conflicted with the movement of record volumes of iron ore, coal, grain and crude oil. One result was the hindrance of two passenger lines that share BNSF's tracks in Minnesota — the Northstar commuter service and Amtrak's Empire Builder.

BNSF, the largest North American railroad by carloads, and other freight rail companies have enjoyed a surge in profits in recent years, thanks in part to the oil boom in North Dakota. However, recent production numbers show a decline in oil and gas production in North Dakota and increased use of pipelines rather than trains to move the commodities.

Late last month, Texas-based BNSF said it plans to reduce capital expenditures nationally for the first time in six years as railroads seek to rein in costs amid a freight slump. The rail carrier said that it will spend $4.3 billion, down 26 percent from a record $5.8 billion in 2015, on locomotives, rail cars, track and maintenance.

Total traffic for large U.S. railroads fell 2.5 percent last year, and the declines continued into 2016, according to data from the Association of American Railroads.

BNSF came under fire from customers and regulators in 2014 after surging crude-oil cargo, a record grain harvest and harsh winter conditions caused service to deteriorate. In reaction, the railroad pumped up spending by almost 50 percent to $11.3 billion in 2014 through 2015 from the previous two years.

The investment has paid off. BNSF's train speeds have recovered and the railroad has added new express routes.