(Reuters) - CSX Corp CSX.O on Tuesday posted quarterly profit that topped Wall Street's target, as the No. 3 U.S. railroad operator benefited from an ongoing cost-cutting drive and rising prices for carrying freight.

FILE PHOTO: A CSX freight train crosses the Potomac River in Harpers Ferry, West Virginia, U.S., October 16, 2012. REUTERS/Gary Cameron/File Photo

CSX shares gained 3.2 percent to $66.50 in extended trading after the company also raised its 2018 revenue forecast, citing strength in its high-margin coal business and a healthy economic backdrop.

Second-quarter net income jumped 72 percent to $877 million, or $1.01 per share, blowing past analysts’ average forecast of 87 cents per share, according to Thomson Reuters I/B/E/S.

Operating ratio, which measures operating expenses as a percentage of revenue and is a closely watched gauge of railroad performance, fell more than expected to 58.6 percent from 67.4 percent in the year-earlier quarter. CSX had aimed to lower the ratio to 60 percent by 2020.

CSX has improved operations by trimming its workforce, reducing service times and running fewer, more fuel-efficient and longer trains under Chief Executive Jim Foote. The measures were initiated by industry turnaround veteran Hunter Harrison, who was CEO when he died in December 2017.

“It’s looking very likely that we’re going to get the kind of transformation that we would have gotten with Hunter Harrison if he were still alive,” Edward Jones analyst Dan Sherman said.

While the CSX turnaround remains in its early stages, Foote told Reuters that he was increasingly confident in his team’s ability to deliver on the plan.

Jacksonville, Florida-based CSX spent 36 percent more on fuel in the latest quarter, but costs fell due to the job cuts and other expense controls.

Revenue for the second quarter grew 6 percent over the prior year to $3.1 billion as CSX raised prices in a tight trucking market.

Total volumes rose 2 percent as increases in coal and forest products, including lumber and paper products, more than offset declines in fertilizers and agricultural and food products.

Foote said the company had not yet seen an impact from the tariff spat as U.S. President Donald Trump seeks to revamp trade policies. CSX gained some business from U.S. steel manufacturers ramping up production, but it took a small hit on soybeans that had been earmarked for export to China.

CSX shares are up about 30 percent since March 2017, when Harrison took the helm following a push by activist investor Paul Hilal of investment fund Mantle Ridge LP.