EXHIBIT 5.1 [LETTERHEAD OF VINSON & ELKINS APPEARS HERE] October 15, 1999 Miller Exploration Company 3104 Logan Valley Road Traverse City, Michigan 49685 Ladies and Gentlemen: We have acted as counsel to Miller Exploration Company, a Delaware corporation (the "Company"), in connection with the preparation of the Company's Registration Statement on Form S-3 (the "Registration Statement"), relating to the proposed offer and sale by certain stockholders of the Company of up to 645,504 shares of the Company's common stock, par value $.01 per share (the "Shares") issuable upon exercise of warrants held by such stockholders (the "Warrants"). In such capacity, we are passing on certain legal matters in connection with the registration of the sale of the Shares. At your request, this opinion is being furnished to you for filing as an exhibit to the Registration Statement. In connection with rendering this opinion, we have examined such certificates, instruments and documents and reviewed such questions of law as we have considered necessary or appropriate for the purposes of this opinion. Based upon the foregoing examination and review, we are of the opinion that the Shares are duly authorized and, when issued upon valid exercise of the Warrants as contemplated by the Registration Statement, will be legally issued, fully paid and nonassessable. The foregoing opinion is limited to the laws of the United States of America and to the General Corporation Law of the State of Delaware. For purposes of this opinion, we assume that the Shares will be issued in compliance with all applicable state securities or Blue Sky laws. Page 2 October 15, 1999 We hereby consent to the filing of this opinion as an exhibit to the Registration Statement. In giving this consent, however, we do not hereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act of 1933 and the rules and regulations of the Securities and Exchange Commission thereunder. Very truly yours, VINSON & ELKINS L.L.P.