EXHIBIT 5.1 OPINION AND CONSENT OF McGUIRE, WOODS, BATTLE & BOOTHE, L.L.P. [McGUIRE, WOODS, BATTLE & BOOTHE, L.L.P. LETTERHEAD] August 8, 1997 CSX Corporation One James Center 901 East Cary Street Richmond, VA 23219 Ladies and Gentlemen: We have acted as counsel to CSX Corporation (the "Company") in connection with the Registration Statement on Form S-4 (the "Registration Statement") being filed by the Company with the Securities and Exchange Commission relating to the proposed issuance by the Company of $350,000,000 in principal amount of 7.05% Debentures Due 2002, $300,000,000 in principal amount of 7.25% Debentures Due 2004, $450,000,000 in principal amount of 7.45% Debentures Due 2007, $400,000,000 in principal amount of 7.90% Debentures Due 2017, $500,000,000 in principal amount of 7.95% Debentures Due 2027, $100,000,000 in principal amount of 6.95% Debentures Due 2027, $250,000,000 in principal amount of 7.25% Debentures Due 2027 and $150,000,000 in principal amount of 8.30% Debentures Due 2032 (collectively, the "New Debentures") registered under the Securities Act of 1933, as amended (the "Securities Act"), in exchange for up to $350,000,000 in principal amount of the Company's outstanding 7.05% Debentures Due 2002, $300,000,000 in principal amount of the Company's outstanding 7.25% Debentures Due 2004, $450,000,000 in principal amount of the Company's outstanding 7.45% Debentures Due 2007, $400,000,000 in principal amount of the Company's outstanding 7.90% Debentures Due 2017, $500,000,000 in principal amount of the Company's outstanding 7.95% Debentures Due 2027, $100,000,000 in principal amount of the Company's outstanding 6.95% Debentures Due 2027, $250,000,000 in principal amount of the Company's outstanding 7.25% Debentures Due 2027 and $150,000,000 in principal amount of the Company's outstanding 8.30% Debentures Due 2032 (collectively, the "Old Debentures"), respectively. The New Debentures will be issued under an Indenture, dated August 1, 1990 (the "Indenture"), as amended and supplemented by the First Supplemental Indenture dated June 15, 1991 and the Second Supplemental Indenture dated May 6, 1997, between the Company and The Chase Manhattan Bank, as trustee (the "Trustee"). We have examined such corporate records, certificates and other documents, and reviewed such questions of law, as we have considered necessary or appropriate for the purpose of this opinion. On the basis of such examination and review, we advise you that, in our opinion, when the Registration Statement has become effective under the Securities Act, and the New Debentures have been duly issued and exchanged in the manner contemplated by the Registration Statement, and assuming due authentication thereof by the Trustee or the Authenticating Agent in accordance with the provisions of the Indenture,as amended and supplemented, the Debentures will constitute valid and legally binding obligations of the Company, enforceable against the Company in accordance with their respective terms, subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and similar laws of general applicability relating to or affecting creditors' rights and to general equity principles. We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the reference to our firm under the caption "Validity of the New Debentures" contained in the Prospectus included therein. In giving this consent we do not admit that we are in the category of persons whose consent is required under Section 7 of the Act. Very truly yours, /s/ McGuire, Woods, Battle & Boothe, L.L.P.