EX-5.1 2 a2173485zex-5_1.htm EXHIBIT 5.1
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

        We consent to the reference to our firm under the caption "Interests of Experts" in the Annual Information Form dated March 22, 2006 which is incorporated by reference in the Registration Statement on Form F-10 and related base shelf prospectus of TransAlta Corporation (the "Corporation"), relating to the registration of Common Shares, First Preferred Shares, Debt Securities or Warrants to purchase Common Shares, First Preferred Shares, Debt Securities or other securities of the Corporation, up to an aggregate initial offering price of US$1,000,000,000 filed with the United States Securities and Exchange Commission on October 13, 2006 and to the incorporation by reference therein of our report dated February 16, 2006 with respect to the consolidated financial statements of the Corporation included in the Corporation's Annual Report to Shareholders (Form 40-F) for the year ended December 31, 2005, filed with the United States Securities and Exchange Commission.

Calgary, Canada   /s/ Ernst & Young LLP
October 13, 2006   Chartered Accountants



QuickLinks