CHICAGO (Reuters) - No. 3 U.S. railroad CSX Corp CSX.O on Wednesday reported a better-than-expected quarterly net profit driven by rising freight volumes across most of the markets it covers and said it plans to cut costs and boost profitability moving forward.

CSX shares rose nearly 3 percent in after-hours trading.

After almost two years in which the Jacksonville, Florida-based railroad experienced precipitous declines in coal freight volumes, CSX experienced a 3 percent increase in coal during the first quarter.

Like the other major U.S. railroads, CSX’s coal volumes had been hit by low energy prices that have encouraged utilities to switch to burning cheaper natural gas and by the strong U.S. dollar which reduced coal exports.

These were also the first quarterly results for CSX since the appointment of veteran railroad executive Hunter Harrison as chief executive officer in March.

Harrison has won renown among investors for turning around three rail companies so far including Canadian National Railway Co CNR.TO and most recently Canadian Pacific Railway Ltd CP.TO using his concept of "precision scheduled railroading."

The concept has been a revolutionary departure from the traditional practice of waiting until a train was full to move it. Under his model, railroads move faster and on schedule, full or not, which Harrison argues increases productivity and cuts costs.

“I am pleased to join the CSX team and working together we are going to make this company the best North American railroad, capable of consistently meeting and exceeding the expectations of our customers and our shareholders,” Harrison said in a statement.

CSX posted first-quarter net profit of $362 million or 39 cents a share, up from $356 million or 37 cents per share a year earlier.

Excluding a one-time restructuring charge of $173 million, the company posted earnings per share of 51 cents. Analysts on average had expected earnings per share of 42 cents.

Revenue in the first quarter increased 10 percent to $2.87 billion from $2.62 billion. That beat analyst expectations of $2.76 billion.

Overall, freight volumes in the first quarter were 3 percent higher than in the same period in 2016.

In after-market trading, CSX shares were up 2.8 percent at $48.23.