EXHIBIT 5.1 ANDREWS & KURTH L.L.P. AUSTIN ATTORNEYS TELEPHONE: 713.220.4200 DALLAS FACSIMILE: 713.220.4285 LONDON 600 TRAVIS, SUITE 4200 LOS ANGELES HOUSTON, TEXAS 77002 NEW YORK THE WOODLANDS WASHINGTON, D.C. May 30, 2003 Board of Directors Valero GP, LLC Valero GP, Inc. One Valero Place San Antonio, Texas 78212 Ladies and Gentlemen: We have acted as special counsel for Valero Logistics Operations L.P., a Delaware limited partnership (the "Operating Partnership") and Valero L.P., a Delaware limited partnership (the "Partnership") with respect to the preparation of the Registration Statement on Form S-4, (the "Registration Statement") filed with the Securities and Exchange Commission (the "Commission") in connection with the registration by the Operating Partnership under the Securities Act of 1933, as amended (the "Securities Act") of (i) the offer and exchange by the Operating Partnership (the "Exchange Offer") of $250,000,000 aggregate principal amount of its 6.05% Senior Notes due 2013 (the "Outstanding Notes"), for a new series of notes bearing substantially identical terms and in like principal amount (the "Exchange Notes") and (ii) the guarantee (the "Guarantee") of the Partnership as guarantor (the "Guarantor") of the Outstanding Notes and the Exchange Notes. The Outstanding Notes and the Exchange Notes are collectively referred to herein as the "Notes." The Outstanding Notes were issued, and the Exchange Notes will be issued, under an Indenture dated as of July 15, 2002 among the Operating Partnership, the Partnership and The Bank of New York, as Trustee, as supplemented by a Second Supplemental Indenture, dated March 18, 2003 (as amended, the "Indenture"). The Exchange Offer will be conducted on such terms and conditions as are set forth in the prospectus contained in the Registration Statement to which this opinion is an exhibit. We have examined originals or copies, certified or otherwise identified to our satisfaction, of (i) the Registration Statement, (ii) the Indenture and (iii) such other certificates, statutes and other instruments and documents as we considered appropriate for purposes of the opinions hereafter expressed. In connection with this opinion, we have assumed (i) the genuineness of the signatures on all documents that we have examined, (ii) the legal capacity of all natural persons, (iii) the authenticity of all the documents supplied to us as originals, (iv) the conformity to the authentic originals of all documents supplied to us as certified or photostatic or faxed copies, and (v) that the Registration Statement, and any amendments thereto (including post-effective amendments), will have become effective and the Exchange Notes will be issued To the Board of Directors May 30, 2003 Page 2 and sold in compliance with applicable federal and state securities laws and in the manner described in the Registration Statement. In conducting our examination of the documents referred to above, we have assumed that the parties to such documents had the power (corporate, partnership, limited liability company or other) to enter into and perform all obligations thereunder and have also assumed the due authorization by all requisite action (corporate, partnership, limited liability company or other) and the due execution and delivery by such parties of such documents and that, to the extent such documents purport to constitute agreements, such documents constitute legal, valid and binding obligations of such parties (other than Operating Partnership and the Guarantor to the extent that we express our opinions with respect to such parties below). Based on the foregoing, we are of the opinion that when the Exchange Notes have been duly executed, authenticated, issued and delivered in exchange for the Outstanding Notes in accordance with the provisions of the Indenture, (i) such Exchange Notes will constitute valid and binding obligations of the Operating Partnership enforceable against the Operating Partnership in accordance with their terms under the laws of the State of New York, and (ii) the Guarantee of the Guarantor will constitute the valid and binding obligations of the Guarantor, enforceable against the Guarantor in accordance with its terms under the laws of the State of New York. Our opinions in the preceding paragraph are subject to applicable bankruptcy, insolvency (including, without limitation, all laws relating to fraudulent transfer or conveyance), reorganization, moratorium and other similar laws affecting creditors' rights generally and to general principles of equity (regardless of whether enforcement is sought in a proceeding in equity or at law), including, without limitation, (a) the possible unavailability of specific performance, injunctive relief or any other equitable remedy and (b) concepts of materiality, reasonableness, good faith and fair dealing, and we express no opinion herein with respect to provisions relating to severability or separability, purporting to provide that all rights and remedies are cumulative, purporting to disregard any course of dealing or implied waivers, or purporting to obligate any party to conform to a standard that may not be objectively determinable. The opinions expressed herein are limited exclusively to the federal laws of the United States of America, the laws of the State of New York and the laws of the State of Delaware, and we are expressing no opinion as to the effect of the laws of any other jurisdiction, domestic or foreign. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the use of our firm name in the prospectus forming a part of the Registration Statement under the caption "Legal Matters." By giving such consent, we do not admit 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 issued thereunder. This opinion is expressed as of the date hereof, and we disclaim any undertaking to advise you of any subsequent changes of the To the Board of Directors May 30, 2003 Page 3 facts stated or assumed herein or any subsequent changes in applicable law, and we have assumed that at no future time would any such subsequent change of fact or law affect adversely our ability to render at such time an opinion (a) containing the same legal conclusions set forth herein and (b) subject only to such (or fewer) assumptions, limitations and qualifications as are contained herein. Very truly yours, /s/ ANDREWS & KURTH L.L.P.