Exhibit 5.1 ----------- [Letterhead of MidAmerican Energy Holdings Company] May 11, 1999 MidAmerican Energy Holdings Company 666 Grand Avenue P.O. Box 657 Des Moines, Iowa 50303-0657 Re: MidAmerican Energy Holdings Company CalEnergy Capital Trust IV CalEnergy Capital Trust V CalEnergy Capital Trust VI Registration Statement on Form S-3 (File No. 333-62697) ------------------------------------------------------- Ladies and Gentlemen: I am the Senior Vice President and General Counsel of MidAmerican Energy Holdings Company, an Iowa corporation (the "Company"). I have served in such capacity in connection with the Registration Statement on Form S-3, as amended by Post-Effective Amendment No. 1 thereto (File No. 333-62697) (the "Registration Statement"), filed with the Securities and Exchange Commission pursuant to the Securities Act of 1933, as amended, for the registration of the sale by the Company from time to time of up to $1,926,587,500 aggregate principal amount of (i) senior debt securities, subordinated debt securities and convertible junior subordinated debt securities (collectively, the "Debt Securities") of the Company, (ii) preferred stock, no par value (the "Preferred Stock"), of the Company, (iii) common stock, no par value (the "Common Stock"), of the Company, (iv) convertible preferred securities (the "Convertible Preferred Securities") of CalEnergy Capital Trust IV, CalEnergy Capital Trust V and CalEnergy Capital Trust VI, each a statutory business trust created under the Business Trust Act of the State of Delaware (each, a "Trust" and, collectively, the "Trusts"), and (v) guarantees of the Convertible Preferred Securities by the Company. I have examined originals or copies, certified or otherwise identified to my satisfaction, of such documents, corporate records, certificates, and other instruments as I have deemed necessary or appropriate as a basis for the opinions set forth herein. MidAmerican Energy Holdings Company CalEnergy Capital Trust IV CalEnergy Capital Trust V CalEnergy Capital Trust VI May 11, 1999 Page 2 In connection with the opinions expressed above, I have assumed that, at or prior to the time of the delivery of any such security, (i) the Company or the relevant Trust, as the case may be, shall have duly established the terms of such security and duly authorized the issuance and sale of such security and such authorization shall not have been modified or rescinded; (ii) such parties other than the Company or the relevant Trust shall have the power, corporate or other, to enter into and perform all obligations in accordance with the documents to be executed by such parties and I have also assumed that upon the execution and delivery by such parties of such documents that such documents shall constitute valid and binding obligations of such parties; (iii) the Registration Statement shall have been declared effective and such effectiveness shall not have been terminated or rescinded; and (iv) there shall not have occurred any change in law affecting the validity or enforceability of such security. I have also assumed that none of the terms of any security to be established subsequent to the date hereof, nor the issuance and delivery of such security, nor the compliance by the Company with the terms of such security will violate any applicable law or will result in a violation of any provision of any instrument or agreement then binding upon the Company or the relevant Trust, or any restriction imposed by any court or governmental body having jurisdiction over the Company or the relevant Trust. Based on and subject to the foregoing and to the other qualifications and limitations set forth herein, I am of the opinion that: 1. Upon designation of the relative rights, preferences and limitations of any series of Preferred Stock by the Board of Directors of the Company and the proper filing with the Secretary of State of the State of Iowa of Articles of Amendment relating to such series of Preferred Stock, all necessary corporate action on the part of the Company will have been taken to authorize the issuance and sale of such series of Preferred Stock proposed to be sold by the Company, and when such shares of Preferred Stock are issued and delivered in accordance with the applicable underwriting or other agreement, such shares of Preferred Stock will be validly issued, fully paid and non-assessable and enforceable in accordance with their terms, except as to the extent that enforcement may be limited by (a) bankruptcy, insolvency, fraudulent conveyance, reorganization, moratorium or other similar laws now or hereinafter in effect relating to or affecting the enforcement of creditors' rights generally and (b) of general principles of equity (regardless of whether considered in a proceeding at law or in equity). MidAmerican Energy Holdings Company CalEnergy Capital Trust IV CalEnergy Capital Trust V CalEnergy Capital Trust VI May 11, 1999 Page 3 2. When all necessary corporate action on the part of the Company has been taken to authorize the issuance and sale of such shares of Common Stock proposed to be sold by the Company under the Registration Statement, including upon conversion of the Debt Securities, the Preferred Stock or the Convertible Preferred Securities, and when such shares of Common Stock are issued and delivered in accordance with the applicable underwriting or other agreement, such shares of Common Stock will be validly issued, fully paid and non-assessable. The opinions expressed herein are limited to the laws of the State of Iowa and the federal laws of the United States of America, and I express no opinion with respect to the laws of any other country, state or jurisdiction. I hereby consent to the filing of this opinion with the Commission as an exhibit to the Registration Statement and to the use of my name under the heading "Legal Matters" in the Registration Statement and in the related prospectus or any supplemental prospectus thereto. This opinion is rendered solely to you in connection with the above matter. This opinion may not be relied upon by you for any other purpose or relied upon by or furnished to any other person without my prior written consent. Very truly yours, /s/ John A. Rasmussen, Jr. John A. Rasmussen, Jr. Senior Vice President and General Counsel