EXHIBIT 5.1 [LATHAM & WATKINS LLP LETTERHEAD] November 10, 2003 MidAmerican Energy Company 666 Grand Avenue Des Moines, Iowa 50303 Re: MidAmerican Energy Company; Registration Statement on Form S-3 (Registration No. 333- ) ----------------------------------------------------- Ladies and Gentlemen: In connection with the Registration Statement on Form S-3 filed by MidAmerican Energy Company, an Iowa corporation (the "Company"), with the Securities and Exchange Commission (the "Commission") under the Securities Act of 1933, as amended (the "Securities Act"), on the date hereof (File No. 333- ) (the "Registration Statement"), you have requested our opinion with respect to the matters set forth below. You have provided us with a draft prospectus (the "Prospectus") which is a part of the Registration Statement. The Prospectus provides that it will be supplemented in the future by one or more supplements to the Prospectus (each, a "Prospectus Supplement"). The Prospectus, as supplemented by various Prospectus Supplements, will provide for the registration by the Company of up to $455,000,000 aggregate offering price of (i) one or more series of senior or subordinated debt securities of the Company (the "Debt Securities"), and (ii) one or more series of preferred stock of the Company, no par value per share (the "Preferred Stock"). The Debt Securities may be issued pursuant to one or more indentures (each, an "Indenture"), in each case between the Company and a trustee (each, a "Trustee"). In our capacity as your special counsel in connection with the Registration Statement, we are generally familiar with the proceedings taken and proposed to be taken by the Company in connection with the authorization and issuance of the Debt Securities. For purposes of this opinion, we have assumed that proceedings to be taken in the future will be timely and properly completed in the manner proposed. In addition, we have examined such matters of fact and questions of law as we have considered appropriate for purposes of this letter. As to facts material to the opinions, statements and assumptions expressed herein, we have, with your consent, relied upon oral or written statements and representations of officers and other representatives of the Company and others. In addition, we have obtained and relied upon such certificates and assurances from public officials as we have deemed necessary. We are opining herein as to the effect on the Debt Securities of the internal laws of the State of New York, and we express no opinion with respect to the applicability thereto, or the effect thereon, of the laws of any other jurisdiction or as to any matters of municipal law or the laws of any local agencies within any state. Certain issues involving the Preferred Stock under the internal laws of the State of Iowa are addressed in the opinion of Paul J. Leighton, Esq., Assistant General Counsel of the Company, and we express no opinion with respect to those matters. Subject to the foregoing and the other qualifications set forth herein, it is our opinion that, as of the date hereof, when (a) the Debt Securities have been duly established in accordance with the applicable Indenture and applicable law, and upon adoption by the Board of Directors of the Company of a resolution in form and content as required by applicable law and upon due authentication, execution and delivery by the Trustee of the Debt Securities on behalf of the Company against payment therefor in the manner contemplated by the Registration Statement, the Prospectus and the related Prospectus Supplement(s) and by such resolution, and (b) the Registration Statement and any required post-effective amendment thereto and any and all Prospectus Supplement(s) required by applicable law have all become effective under the Securities Act, and assuming that (i) the terms of the Debt Securities as executed and delivered are as described in the Registration Statement, the Prospectus and the related Prospectus Supplement(s), (ii) the Debt Securities as executed and delivered do not violate any law applicable to the Company or result in a default under or breach of any agreement or instrument binding upon the Company, (iii) the Debt Securities as executed and delivered comply with all requirements and restrictions, if any, applicable to the Company, whether imposed by any court or governmental or regulatory body having jurisdiction over the Company or otherwise, and (iv) the Debt Securities are then issued and sold as contemplated in the Registration Statement, the Prospectus and the related Prospectus Supplement(s), the Debt Securities will constitute the legally valid and binding obligations of the Company, enforceable against the Company in accordance with the terms of the Debt Securities. The opinions set forth in the immediately preceding paragraph are subject to the following exceptions, limitations and qualifications: (i) the effect of bankruptcy, insolvency, reorganization, moratorium or other similar laws now or hereafter in effect relating to or affecting the rights and remedies of creditors; (ii) the effect of general principles of equity, whether enforcement is considered in a proceeding in equity or at law (including the possible unavailability of specific performance or injunctive relief), concepts of materiality, reasonableness, good faith and fair dealing, and the discretion of the court before which any proceeding therefor may be brought; (iii) the unenforceability under certain circumstances under law or court decisions of provisions providing for the indemnification of or contribution to a party with respect to a liability where such indemnification or contribution is contrary to public policy; (iv) we express no opinion concerning the enforceability of any waiver of rights or defenses with respect to stay, extension or usury laws; and (v) we express no opinion with respect to whether acceleration of the Debt Securities may affect the collectibility of any portion of the stated principal amount thereof which might be determined to constitute unearned interest thereon. We have not been requested to express, and with your knowledge and consent do not render, any opinion as to the applicability to the obligations of the Company under the Debt Securities of Sections 547 and 548 of the United States Bankruptcy Code or applicable state law (including, without limitation, Article 10 of the New York Debtor and Creditor Law) relating to preferences and fraudulent transfers and obligations. With your consent, we have assumed for purposes of this opinion that (i) the Company has been duly organized, is validly existing, and is in good standing as a corporation under the laws of the State of Iowa and has the corporate power and authority to issue and sell the Debt Securities and to execute, deliver and perform its obligations under the applicable Indenture; (ii) the Debt Securities have been duly authorized by all necessary corporate action by the Company; (iii) the applicable Indenture has been duly authorized by all necessary corporate action by the Company, has been duly executed and delivered by the Company and constitutes a legal, valid and binding obligation of the Company enforceable against the Company in accordance with its terms; (iv) the Trustee for each applicable Indenture has been duly organized, is validly existing and is in good standing under the laws of its jurisdiction of organization; (v) the Trustee is duly qualified to engage in the activities contemplated by the applicable Indenture; (vi) the applicable Indenture has been duly authorized, executed and delivered by the Trustee and constitutes a legal, valid and binding obligation of the Trustee, enforceable against the Trustee in accordance with its terms; (vii) the Trustee is in compliance, generally and with respect to acting as Trustee under the applicable Indenture, with all applicable laws and regulations; and (viii) the Trustee has the requisite organizational and legal power and authority to perform its obligations under the applicable Indenture. We consent to your filing this opinion as an exhibit to the Registration Statement and to the reference to our firm under the caption "Legal Matters" in the Prospectus included therein. This opinion is rendered only to you and is solely for your benefit in connection with the transactions covered hereby. This opinion may not be relied upon by you for any other purpose, or furnished to, quoted to, or relied upon by any other person, firm or corporation for any purpose, without our prior written consent. Very truly yours, /s/ Latham & Watkins LLP