1 EXHIBIT 5.1 January 18, 1999 TransAmerican Refining Corporation 1300 North Sam Houston Parkway East Suite 320 Houston, Texas 77032-2949 Gentlemen: We have served as counsel for TransAmerican Refining Corporation, a Texas corporation (the "COMPANY"), in connection with the Registration Statement on Form S-4 (the "REGISTRATION STATEMENT") filed with the Securities and Exchange Commission in connection with the registration under the Securities Act of 1933, as amended (the "1933 ACT"), of $200,000,000 principal amount of the Company's 16% Series B Senior Subordinated Notes due 2003 (the "NOTES") to be offered in exchange for the Company's outstanding $175,000,000 principal amount 16% Series A Senior Subordinated Notes due 2003 and $25,000,000 principal amount 16% Series C Senior Subordinated Notes due 2003. We have examined the Registration Statement, the Indenture between the Company and First Union National Bank, as Trustee, pursuant to which the Notes are to be issued (the "INDENTURE"), the form of the Notes to be issued and such other documents and such questions of law as we have deemed necessary to render the opinion expressed below. In our examination, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the authenticity of all documents submitted to us as originals, the conformity to original documents of all documents submitted to us as copies, and the authenticity of the originals of such copied documents. We have also assumed, with respect to all persons and entities other than the Company, the power (corporate or otherwise) of such persons or entities to enter into and perform all of their obligations under the Indenture, the due authorization by all requisite action (corporate or otherwise) on the part of such persons or entities, the due execution and delivery by such persons or entities of such document, and the validity and binding effect thereof. As to any facts material to the opinion expressed herein that we did not independently establish or verify, we have relied upon oral or written statements, certificates and representations of officers and other representatives of the Company and others. 2 January 18, 1999 Page 2 Based upon the foregoing, and subject to the qualifications set forth below, we are of the opinion that when the Notes are executed and authenticated in accordance with the terms of the Indenture and delivered in the manner and for the consideration described in the Registration Statement, the Notes will be binding and enforceable obligations of the Company. The opinion expressed above is subject to the following qualifications: A. The binding nature and enforceability of the Notes may be limited by (i) bankruptcy, insolvency, reorganization, moratorium, fraudulent conveyance or transfer, and other similar laws affecting the enforcement of creditors' rights generally and (ii) equitable principles of general application and judicial discretion that may limit or affect the availability or grant of certain equitable remedies in certain instances. In addition, the binding nature and enforceability of certain of the remedial, waiver and other provisions of the Notes, or of the Indenture for the Notes, may be restricted by applicable state law, but such restrictions will not, in our opinion, render the Notes invalid as a whole or substantially interfere with the realization of the principal legal benefits purported to be provided by the Notes or by the Indenture for the Notes (except to the extent of any procedural delay which may result therefrom). Further, the binding nature and enforceability of the indemnification provisions of the Indenture may be limited by public policies embodied in or reflected by various state and federal securities laws. B. The opinion expressed herein is limited to the laws of the United States of America and the laws of the State of Texas, and we assume no responsibility as to the applicability or the effect of any other laws. We have assumed that the laws of the State of New York, which purport to govern the Notes and the Indenture, are the same as the laws of the State of Texas with respect to the binding nature and enforceability of the Notes. We consent to the use of this opinion letter as an exhibit to the Registration Statement and to the use of our name in the Registration Statement under the heading "Legal Matters." Our consent, however, is not an admission that we come within the category of persons whose consent is required under Section 7 of the 1933 Act or the rules and regulations of the Securities and Exchange Commission. Very truly yours, GARDERE & WYNNE, L.L.P. By: /s/ C. ROBERT BUTTERFIELD --------------------------------- C. Robert Butterfield, Partner