EXHIBIT 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM
We hereby consent to incorporation by reference in the Registration Statement Form S-8 (No. 333-208647) of Canadian Pacific Kansas City Limited of our report dated June 17, 2026, relating to the financial statements and supplemental schedule of The CPKC 401(k) Savings Plan (formerly CP 401(k) Savings Plan), which appears in this Form 11-K.

/s/ Armanino LLP

St. Louis, Missouri
June 17, 2026