Union Pacific (UNP) said Thursday its second-quarter profit grew 10%, as the railroad operator saw revenue climb amid pricing gains and higher coal shipments.

With the rapid growth of U.S. shale oil and gas, producers have largely depended on railroads like Union Pacific to move oil and gas to refineries, given the lack of pipeline infrastructure in certain regions. Union Pacific also transports materials such as pipe, steel and sand used in horizontal drilling.

In the second quarter, overall carload volume slipped 0.5%, although average revenue per carload grew 5.5%.

Chemical shipments, which include crude oil, were up 10%. Low natural gas prices have put pressure on coal used to generate electricity, but shipments were up 0.5%. Average revenue per car jumped 12%.

Automotive shipments also posted gains, climbing 3.7%, while agricultural shipments fell 10%.

“Union Pacific achieved record financial milestones this quarter,” Chief Executive Jack Koraleski said in a statement. “We managed our network efficiently and continued to show the agility of our strong franchise. When combined with solid core pricing gains, we more than offset the slight shortfall in volumes to generate best-ever quarterly earnings and operating ratio performance.”

Union Pacific reported a $1.11 billion profit, or $2.37 a share, up from $1 billion, or $2.10 a share, in the year-ago period. Analysts were looking for per-share earnings of $2.35.

Revenue grew 4.8% to $5.47 billion, falling just shy of Wall Street’s forecast for $5.5 billion.

Operating margin widened to 34.3% from 33%.

Rival CSX (CSX) was the first major railroad to report quarterly results, posting 4.5% earnings growth on stronger merchandise and intermodal shipments that outweighed lower coal volume.

Norfolk Southern (NSC) plans to report second-quarter results on July 23.

Shares of Union Pacific fell 1% to $158.00 in early morning trading.

Follow Matthew Rocco on Twitter @MatthewRocco