EX-5.1 2 a2145371zex-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

October 26, 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 (the "Rights"), as described in the Company's Amendment No. 1 to the Registration Statement on Form S-3 (Reg. No. 333-117183) filed with the Securities and Exchange Commission with respect to the Debentures, the Shares and the Rights (as amended, 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 (other than the authorization of the Debentures), 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:

        (i)    the Debentures have been duly authorized and constitute valid and binding obligations of the Company, enforceable against the Company in accordance with their terms;

        (ii)   the Shares and accompanying Rights are duly authorized and when issued on conversion of the 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; and

        (iii)  the Rights are, subject to the terms of that certain Third Amended and Restated Rights Agreement dated as of September 15, 2004 (the "Rights Agreement"), between the Company and Wells Fargo Bank, N.A. as Rights Agent, binding obligations of the Company.

        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 reported judicial interpretations of such law, and we are expressing no opinion as to the effect of the laws of any other jurisdiction.



        The enforceability of the Debentures and the Rights may be limited or affected by (a) bankruptcy, insolvency, reorganization, moratorium, liquidation, rearrangement, probate, conservatorship, fraudulent transfer, fraudulent conveyance and other similar laws (including court decisions) now or hereafter in effect and affecting the rights and remedies of creditors generally or providing for the relief of debtors, (b) the refusal of a particular court to grant (i) equitable remedies, including, without limiting the generality of the foregoing, specific performance and injunctive relief, or (ii) a particular remedy sought under such documents as opposed to another remedy provided for therein or another remedy available at law or in equity, (c) general principles of equity (regardless of whether such remedies are sought in a proceeding in equity or at law) and (d) judicial discretion.

        The opinion expressed in paragraph (iii) hereof is further subject to the limitations that:

            (a)   We have assumed that the triggering event causing the issuance of the preferred stock pursuant to the Rights occurs on the date hereof, when the Company has sufficient authorized but unissued shares of preferred stock fully to provide for the exercise of the outstanding Rights.

            (b)   We express no opinion as to how a particular court, in the exercise of its equitable powers, would treat the Rights or whether it would enforce the Rights, in light of all the facts and circumstances existing at the time of a triggering event causing the issuance of the preferred stock pursuant to the Rights.

        This opinion is given as of the date hereof, and we assume no obligation to update or supplement this opinion to reflect any facts or circumstances which may hereafter come to our attention or any changes in laws which may hereafter occur.

        We hereby consent to the filing of this opinion as an exhibit to the Registration Statement and to the use of our name under the caption "Legal Matters" in the prospectus included as part of the Registration Statement.

                        Very truly yours,

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

                        Fulbright & Jaworski L.L.P.




QuickLinks