Exhibit 5(b) LeBoeuf, Lamb, Greene & MacRae L.L.P. A limited liability partnership including professional corporations 125 West 55th Street New York, NY 10019-5389 January 20, 2004 MDU Resources Group, Inc. Schuchart Building 918 East Divide Avenue, P.O. Box 5650 Bismarck, North Dakota 58506-5650 Ladies and Gentlemen: We are acting as counsel for MDU Resources Group, Inc., a Delaware corporation (the "Company"), in connection with the preparation and filing with the Securities and Exchange Commission (the "Commission") under the Securities Act of 1933, as amended (the "Securities Act"), of the Company's registration statement on Form S-8 (the "Registration Statement") for the registration of 1,500,000 shares of the Company's common stock, par value $1.00 per share (the "Stock"), and the preference share purchase rights attached thereto (the "Rights"), to be issued and sold pursuant to the Company's 1998 Option Award Program (the "Plan"). In connection with this opinion, we have examined originals or copies, certified or otherwise identified to our satisfaction, of (i) the Registration Statement, (ii) the Rights Agreement, dated as of November 12, 1998, between the Company and Wells Fargo Bank, N.A. (formerly known as Norwest Bank Minnesota, N.A.), as Rights Agent, together with the exhibits thereto (the "Rights Agreement"), pursuant to which the Rights were created, (iii) the Restated Certificate of Incorporation and the Bylaws, as amended, of the Company, as in effect on the date hereof, (iv) resolutions of the Board of Directors of the Company, dated February 15, 2001, authorizing the issuance of the Stock and (v) such other instruments, certificates, records and documents, and such matters of law, as we have considered necessary or appropriate for the purposes hereof. In such examination, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals, the conformity to the original documents of all documents submitted to us as copies and the authenticity of the originals of such latter documents. As to any facts material to our opinion, we have, when relevant facts were not independently established, relied upon the aforesaid Registration Statement, Rights Agreement, resolutions, instruments, certificates, records and documents. We have also assumed the regularity of all corporate procedures. Based upon the foregoing, and subject to the limitations and qualifications contained in this opinion, we are of the opinion that: 1. The issuance of the Stock has been duly authorized by the Board of Directors of the Company. 2. When the Federal Energy Regulatory Commission, the Montana Public Service Commission and the Public Service Commission of Wyoming shall have issued orders authorizing the issuance and sale of the Stock, and provided that such orders remain in full force and effect and have not been amended, rescinded or repealed, the Stock will be validly issued, fully paid and non-assessable when the Stock shall have been issued, sold and delivered for the consideration contemplated in the Plan. 3. The issuance of the Rights has been validly authorized by all necessary corporate action on the part of the Company and, when issued in accordance with the Rights Agreement, the Rights will be legally issued and binding obligations of the Company. We express no opinion with respect to any laws other than the General Corporation Law of the State of Delaware, the applicable provisions of the Delaware Constitution and the reported judicial decisions interpreting the Delaware laws, and the federal laws of the United States. We hereby consent to the use of this opinion as an exhibit to the Registration Statement. In giving such consent, we do not thereby concede that we are within the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission thereunder. Very truly yours, /s/ LeBoeuf, Lamb, Greene & MacRae, L.L.P.