OMAHA, Neb. — CSX Corp. said Tuesday that rate increases and a small improvement in the volume of products the railroad hauled helped it deliver 4 percent profit growth even though coal shipments remained down.

The Jacksonville, Fla.- based railroad said it generated $535 million net income, or 52 cents per share, during the quarter on $3.07 billion revenue. That's up from $512 million, or 49 cents per share, on $3.01 billion revenue last year.

The total number of carloads CSX delivered in the second quarter grew 1 percent even though coal shipments were still down 6 percent. Shipments of crude oil, fertilizer and intermodal containers of products drove the volume increase.

The results beat the 47 cents per share profit and $3.02 billion revenue that analysts surveyed by FactSet expected.

CSX shares gained 48 cents to $25.12 in after-hours trading.

"We remain sharply focused on creating strong, sustained value for customers and shareholders, as the economy appears to be slowly gaining strength," said Michael Ward, CSX's chairman, president and CEO.

CSX has been grappling with significantly lower coal demand for a couple years because relatively cheap natural gas prices and environmental concerns prompted a number of utilities to switch from coal to gas.

But it appears that coal demand is beginning to stabilize, and CSX said domestic coal shipments increased in the quarter as natural gas prices rose.

The other areas where shipping volume declined were agricultural products, metals, construction and military equipment and alcoholic beverages.

Investors watch what major freight railroads are carrying closely because railroads are indicators of the nation's economic health.

CSX operates over 21,000 miles of track in 23 eastern states and two Canadian provinces.

CSX is the first major U.S. freight railroad to release second-quarter earnings. Union Pacific Corp. will release its first-quarter results on Thursday, and Norfolk Southern Corp. will follow next Tuesday.