July 28 (Reuters) - Canadian Pacific Railway Ltd topped quarterly profit estimates on Wednesday, boosted by a recovery from the pandemic-led slump in freight volumes.

Analysts had indicated a rebound in Canadian rail traffic through much of the second quarter, driven by a healthy recovery in the North American economy from last year's pandemic-induced lows.

"Despite near term headwinds - forex, fuel pricing, network fire disruptions - we continue to view both Canadian National and Canadian Pacific as well situated to further benefit from ongoing recovery tailwinds," Raymond James analyst Steve Hansen said in a pre-earnings note.

Canadian Pacific's operating ratio, a measure of operating expenses as a percentage of revenue, rose to 60.1% in the second quarter from 57% a year earlier. A lower operating ratio signals improved profitability.

Total carloads - the volume of freight loaded into cars during a specified period - rose 14.6%, boosted by higher coal, automotive, metal, minerals and intermodal shipments.

Excluding items, the company earned C$1.03 per share. Analysts on average had expected a profit of C$1.01 per share, according to Refinitiv data.

Revenue rose to C$2.05 billion from C$1.79 billion. ($1 = 1.2527 Canadian dollars) (Reporting by Sanjana Shivdas and Mrinalika Roy in Bengaluru; Editing by Shinjini Ganguli)