EX-5.1 2 a2139685zex-5_1.htm EXHIBIT 5.1
QuickLinks -- Click here to rapidly navigate through this document


Exhibit 5.1

FULBRIGHT & JAWORSKI L.L.P.
A REGISTERED LIMITED LIABILITY PARTNERSHIP
1301 MCKINNEY, SUITE 5100
HOUSTON, TEXAS 77010-3095
WWW.FULBRIGHT.COM

TELEPHONE:   (713) 651-5151       FACSIMILE:   (713) 651-5246

July 6, 2004

Quanex Corporation
1900 West Loop South, Suite 1500
Houston, Texas 77027

Ladies and Gentlemen:

        We have acted as counsel to Quanex Corporation, a Delaware corporation (the "Company") in connection with the registration under the Securities Act of 1933, as amended, of $125,000,000 principal amount of the Company's 2.50% Convertible Senior Debentures due 2034 (the "Debentures") and 2,173,989 shares of the Company's common stock, par value $.50 per share, which are issuable on conversion of the Debentures (the "Shares"), and accompanying Rights to purchase Series A Junior Participating Preferred Stock, as described in the Company's Registration Statement on Form S-3 to be filed with the Securities and Exchange Commission with respect to the Debentures and the Shares (the "Registration Statement").

        In connection with the foregoing, we have examined originals or copies of such corporate records, as applicable, of the Company, certificates and other communications of public officials, certificates of officers of the Company and such other documents as we have deemed necessary for the purpose of rendering the opinions expressed herein. As to questions of fact material to those opinions, we have, to the extent we deemed appropriate, relied on certificates of officers of the Company and on certificates and other communications of public officials. We have assumed the genuineness of all signatures on, and the authenticity of, all documents submitted to us as originals, the conformity to authentic original documents of all documents submitted to us as copies, the due authorization, execution and delivery by the parties thereto of all documents examined by us, and the legal capacity of each individual who signed any of those documents.

        Based upon the foregoing, and having due regard for such legal considerations as we deem relevant, we are of the opinion that the Debentures have been validly issued and the Shares, when issued on conversion of Debentures in accordance with the terms of the Debentures and that certain Indenture dated as of May 5, 2004 (the "Indenture"), between the Company and Union Bank of California, N.A, as trustee, will be duly and validly issued, fully paid and nonassessable.

        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 applicable provisions of, respectively, the Delaware Constitution, the Delaware General Corporation Law and reported judicial interpretations of such law, and we are expressing no opinion as to the effect of the laws of any other jurisdiction.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement.

                        Very truly yours,

                        /s/ Fulbright & Jaworski L.L.P.

HOUSTON · NEW YORK · WASHINGTON DC · AUSTIN · DALLAS · LOS ANGELES · MINNEAPOLIS · SAN ANTONIO · HONG KONG · MUNICH




QuickLinks