Shares of the Jacksonville, Fla. company were up 3.1% to $32.55 in after-hours trading.
CSX reported net income of $1.17 billion, or 52 cents a share, up from $499 million or 22 cents a share a year ago. Adjusted earnings were 40 cents a share.
The results include benefits from the sale of property rights in line segments to the Commonwealth of Virginia for passenger rail operations, which helped earnings rise by 12 cents a share.
Revenue totaled $2.99 billion, up 33% from a year ago, the company said, driven by growth across all lines of business.
Analysts surveyed by FactSet were expecting the company to report earnings of 37 cents a share on revenue of $2.928 billion.
The second-quarter operating ratio was 43.4% compared with 63.3% a year ago.
Expenses decreased 9% year over year to $1.30 billion and operating income improved to $1.69 billion for the quarter.
“I want to thank all the CSX railroaders for their dedicated and unwavering focus on our customers as the economy has rebounded,” president and CEO James Foote said in a statement. “We are committed to providing customers a high quality service product, and will continue taking all necessary steps to meet their needs.”
In June, CSX said its board had approved a 3-for-1 stock split to be distributed to shareholders as a stock dividend.
CSX and other railroad stocks took a hit earlier this month after a report said the Biden administration would urge regulators to fight monopolist trends in the industry.