Excluding income tax benefits of 4 cents per share, the company posted EPS of 89 cents, matching analysts' average target, according to Reuters Estimates.
"The strong earnings performance delivered by this team was supported by all time records in revenue and operating income, despite the effects of a softer economy," Chief Executive Michael Ward said in a statement.
Although freight volumes in its coal and agricultural divisions rose 2 percent and 5 percent, respectively, most freight types saw declines in the quarter.
Automotive shipments fell 23 percent, reflecting a weak year for the U.S. auto industry, while intermodal shipments were down 2 percent. Intermodal shipments rely on standardized containers that haul mostly consumer goods or finished products.
While intermodal shipments were down, revenue in the segment rose 12 percent due to price increases.
Total revenue jumped 15 percent to $2.91 billion from $1.78 billion. Analysts expected $2.83 billion.
Like the other major U.S. railroads, CSX has posted strong profits in recent quarters despite a slowing U.S. economy and higher fuel prices, due largely to strong pricing.
For the full year, CSX expects EPS at the upper end of a range from $3.40 to $3.60 a share. Analysts look for full-year EPS of $3.57.
The second quarter was a tumultuous one for CSX , as the freight railroad operator geared up for a fight to defend its corporate governance to a group of activist investors demanding change.
--CNBC.com staff contributed to this report.