CSX's profit declined 4% in the third quarter, but tight cost controls helped the railroad weather a 5% decline in volume.

The Jacksonville, Florida, based railroad said it earned $856 million, or $1.08 per share, during the quarter. That was down from last year's $894 million, or $1.05 per share.

The results topped Wall Street expectations. The analysts surveyed by Zacks Investment Research expected CSX to report earnings of $1.01 per share.

The railroad's revenue decreased 5% to $2.98 billion, which was roughly in line with analyst expectations.

CSX said its expenses declined 8% to $1.69 billion in the quarter as it continued working to improve efficiency.

CSX Corp. is more than two years into an operational overhaul designed to enable the railroad to handle more volume with fewer locomotives and employees by operating on a tighter schedule.

CSX's shares have climbed 11% since the beginning of the year, while the Standard & Poor's 500 index has risen 19%. Its stock was up about 2% to $70.60 in extended trading following the release of the earnings report.

The railroad operates more than 21,000 miles of track in 23 Eastern states and two Canadian provinces.

Elements of this story was generated by Automated Insights (http://automatedinsights.com/ap) using data from Zacks Investment Research. Access a Zacks stock report on CSX at https://www.zacks.com/ap/CSX