EXHIBIT 5.1 [Willkie Farr & Gallagher Letterhead] August 29, 1996 CalEnergy Capital Trust c/o CalEnergy Company, Inc. 302 South 36th Street, Suite 400 Omaha, Nebraska 68131 Re: CalEnergy Company, Inc.; CalEnergy Capital Trust; Registration Statement on Form S-3 Ladies and Gentlemen: We have acted as special counsel to CalEnergy Company, Inc., a Delaware corporation (the "Company"), and CalEnergy Capital Trust, a statutory business trust formed under the laws of the State of Delaware (the "Trust"), in connection with the preparation of a Registration Statement on Form S-3 (File No. 333-08315), as filed by the Company and the Trust with the Securities and Exchange Commission (the "Commission") on July 17, 1996 under the Securities Act of 1933, as amended (the "Act") and Amendment No. 1 thereto, as filed on the date hereof (such Registration Statement, as so amended, being hereinafter referred to as the "Registration Statement"), relating to the registration under the Act of (i) 2,078,600 6 1/4% Convertible Preferred Securities Term Income Deferrable Equity Securities (TIDES)SM or TIDES SM (liquidation preference $50 per each of the TIDES) (the "TIDES") representing undivided beneficial ownership interests in the assets of the Trust; (ii) 6 1/4% Convertible Junior Subordinated Debentures Due 2016 (the "Convertible Junior Subordinated Debentures") of the Company, which may be distributed under certain circumstances to the holders of the TIDES; (iii) the shares of common stock, par value $0.0675 per share (the "Common Stock"), of the Company issuable upon conversion of the TIDES and the Convertible Junior Subordinated Debentures; and (iv) the Preferred Securities Guarantee of the Company (as defined below). CalEnergy Capital Trust August 29, 1996 page 2 The TIDES were issued pursuant to the Amended and Restated Declaration of Trust (the "Declaration"), dated as of April 4, 1996, among the Company, as sponsor, The Bank of New York, as property trustee (the "Property Trustee"), The Bank of New York (Delaware), as the Delaware trustee (the "Delaware Trustee"), and Steven A. McArthur, John G. Sylvia and Gregory Abel, as regular trustees (together, the "Regular Trustees"). Capitalized terms used but not otherwise defined herein have the meanings ascribed to them in the Registration Statement. This opinion is being delivered in accordance with the requirements of Item 601(b)(5) of Regulation S-K under the Act. In connection with this opinion, we have examined originals or copies, certified or otherwise identified to our satisfaction, of (i) the certificate of trust (the "Certificate of Trust") filed by the Property Trustee, the Delaware Trustee and the Regular Trustees with the Secretary of State of the State of Delaware on April 3, 1996; (ii) the Declaration (including the form of the terms of the TIDES annexed thereto); (iii) specimens of the TIDES; (iv) the preferred securities guarantee agreement, dated as of April 10, 1996 (the "Preferred Securities Guarantee"), between the Company and The Bank of New York, as trustee; (v) specimens of the Convertible Junior Subordinated Debentures, which were issued pursuant to an indenture dated as of April 1, 1996 (the "Indenture"), between the Company and The Bank of New York, as trustee; (vi) the Indenture; and (vii) certain resolutions of the Board of Directors of the Company relating to the issuance of the Convertible Junior Subordinated Debentures and the shares of Common Stock issuable upon conversion thereof. We have also examined originals or copies, certified or otherwise identified to our satisfaction, of such other documents, certificates and records as we have deemed necessary or appropriate as a basis for the opinions set forth herein. In our examination, we have assumed the legal capacity of all natural persons, the genuineness of all signatures, the authenticity of all documents submitted to us as originals, the conformity to original documents of all documents submitted to us as certified or photostatic copies and the authenticity of the originals of such copies. In making our examination of documents executed by parties other than the Trust and the Company, we have assumed that such -2- CalEnergy Capital Trust August 29, 1996 page 3 parties had the power, corporate or other, to enter into and perform all obligations thereunder and have also assumed the due authorization by all requisite action, corporate or other, and execution and delivery by such parties of such documents and that such documents constitute valid and binding obligations of such parties. As to any facts material to the opinions expressed herein which were not independently established or verified, we have relied upon oral or written statements and representations of officers, trustees and other representatives of the Company, the Trust and others. The opinions expressed herein are limited to the laws of the State of New York, the General Corporation Law of the State of Delaware and the federal laws of the United States of America, and we express no opinion with respect to the laws of any other country, state or jurisdiction. Based on and subject to the foregoing and to the other qualifications and limitations set forth herein, we are of the opinion that: 1. The Preferred Securities Guarantee is a valid and binding agreement of the Company, enforceable against the Company in accordance with its terms, except to the extent that (a) enforcement thereof may be limited by (i) bankruptcy, insolvency, reorganization, moratorium, or other similar laws now or hereafter in effect relating to creditor's rights generally and (ii) general principles of equity (regardless of whether enforceability is considered in a proceeding at law or in equity). 2. The Convertible Junior Subordinated Debentures are valid and binding obligations of the Company, entitled to the benefits of the Indenture and enforceable against the Company in accordance with their terms, except to the extent that enforcement thereof may be limited by (i) bankruptcy, insolvency, reorganization, moratorium or other similar laws now or hereafter in effect relating to creditors' rights generally and (ii) general principles of equity (regardless of whether enforceability is considered in a proceeding at law or in equity). This opinion is furnished to you solely for your benefit in connection with the filing of the Registration Statement and, except as set forth in the next sentence, is not to be -3- CalEnergy Capital Trust August 29, 1996 page 4 used, circulated, quoted or otherwise referred to for any other purpose or relied upon by any other person for any purpose without our prior written consent. We also consent to the use of our name under the heading "Legal Matters" in the Registration Statement and in the related Prospectus. We hereby consent to the filing of this opinion with the Commission as Exhibit 5 to the Registration Statement. In giving this consent, we do not thereby admit that we are within the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission promulgated thereunder. This opinion is expressed as of the date hereof unless otherwise expressly stated and we disclaim any undertaking to advise you of any subsequent changes of the facts stated or assumed herein or any subsequent changes in applicable law. Very truly yours, /s/ Willkie Farr & Gallagher -4-