Exhibit 5.1 April 8, 2004 Atlas Pipeline Partners, L.P. 311 Rouser Road Moon Township, PA 15108 Ladies and Gentlemen: We have acted as counsel to Atlas Pipeline Partners, L.P., a Delaware limited partnership ("Atlas"), Atlas Pipeline Operating Partnership, L.P., a Delaware limited partnership, Atlas Pipeline New York, LLC, a Pennsylvania limited liability company, Atlas Pipeline Ohio, LLC, a Pennsylvania limited liability company, and Atlas Pipeline Pennsylvania, LLC, a Pennsylvania limited liability company, in connection with the preparation and filing by these entities of a registration statement on Form S-3 under the Securities Act of 1933, as amended, File No. 333-113523 (the "Registration Statement"), the Prospectus included therein dated April 5, 2004 (the "Prospectus"), and the Prospectus Supplement of even date herewith (the "Prospectus Supplement") with respect to the offer and sale by Atlas of up to 862,500 common units of limited partnership interest of Atlas (the "Common Units"). In connection therewith, you have requested our opinion as to certain matters referred to below. In our capacity as such counsel, we have familiarized ourselves with the actions taken by Atlas in connection with the registration of the Common Units. We have examined the originals or certified copies of such records, agreements, certificates of public officials and others, and such other documents, including the Registration Statement and the Prospectus Supplement, as we have deemed relevant and necessary as a basis for the opinions hereinafter expressed. Based upon and subject to the foregoing, we are of the opinion that: 1. Atlas is a limited partnership which has been duly formed, is validly existing and is in good standing under the Delaware Revised Uniform Limited Partnership Act. 2. When sold as set forth in the Registration Statement, Prospectus and Prospectus Supplement, the Common Units will be validly issued, fully paid and non-assessable, except as such nonassessment may be affected by the matters described in the Prospectus under the caption "Our Partnership Agreement--Limited Liability." The opinion expressed herein is limited to the Delaware Revised Uniform Limited Partnership Act, as currently in effect. We consent to the reference to this opinion and to Ledgewood Law Firm, P.C. in the Prospectus and Prospectus Supplement, and to the inclusion of this opinion as an exhibit to the Registration Statement. Very truly yours, /s/ Ledgewood Law Firm, P.C. ---------------------------- LEDGEWOOD LAW FIRM, P.C.