EXHIBIT 5.1 Cohen Brame & Smith Professional Corporation Attorneys at Law 1700 Lincoln Street, Suite 1800 Denver, Colorado 80203 (303) 837-8800 FAX (303) 894-0475 June 29, 1998 Mark A. Hellerstein, President St. Mary Land & Exploration Company 1776 Lincoln Street, Suite 1100 Denver, Colorado 80203 Re: Form S-8 Registration Statement Relating to Shares of $.01 Par Value Common Stock Dear Mr. Hellerstein: We have acted as counsel for St. Mary Land & Exploration Company ("St. Mary") in connection with the Form S-8 Registration Statement to be filed by St. Mary with the Securities and Exchange Commission relating to the shares of St. Mary $.01 par value common stock (the "Common Stock") issuable pursuant to the St. Mary Land & Exploration Company Employee Stock Purchase Plan. As such counsel, we have examined and relied upon such records, documents, certificates and other instruments as in our judgment are necessary or appropriate to form the basis for the opinions hereinafter set forth. Based upon the foregoing, we are of the opinion that: (i) St. Mary is a corporation duly incorporated and validly existing in good standing under the laws of the State of Delaware. (ii) The shares of Common Stock issuable pursuant to the Employee Stock Purchase Plan, when issued in accordance with the terms set forth therein and in the Registration Statement, will be validly issued and outstanding, fully paid and nonassessable. We consent to the filing of this opinion as an Exhibit to the Registration. Very truly yours, /s/ COHEN BRAME & SMITH PROFESSIONAL CORPORATION Cohen Brame & Smith Professional Corporation 17