CSX Corp. surged in late trading after record efficiency powered earnings well past Wall Street’s estimates.

The second-quarter operating ratio, an industry measure that compares expenses with sales, improved to an all-time best for a U.S. railroad. Profit almost doubled on a per-share basis, CSX said in a statement Tuesday, boosted in part by the U.S. tax cut.

The results underscored Chief Executive Officer Jim Foote’s ability to build on operating gains forged by his predecessor, Hunter Harrison, who died in December. The company benefited last quarter from robust cargo demand for coal, forest products and consumer goods, while also lowering costs.

The shares rose as much as 4 percent to $67 after the market close in New York. CSX has gained 17 percent this year through the close on Tuesday, the most among major North American railroads.

Earnings rose to $1.01 a share, topping analysts’ estimates by 14 cents. Revenue climbed 5.8 percent to $3.1 billion.

Expenses dropped 7.9 percent to $1.82 billion. That gave the company a record operating ratio, an efficiency measure in which a lower number is better, of 58.6 percent. That’s down from 63.5 percent a year earlier.