<PAGE>

                                  EXHIBIT 10.5

                               SECOND AMENDMENT TO
                   THIRD AMENDED AND RESTATED CREDIT AGREEMENT

         THIS SECOND AMENDMENT TO THIRD AMENDED AND RESTATED CREDIT AGREEMENT
(this "Second Amendment"), dated as of August 20, 2001, is entered into among
       ----------------
TEXAS INDUSTRIES, INC., a Delaware corporation (the "Borrower"), the banks
                                                     --------
listed on the signature pages hereof (the "Lenders"), certain Co-Agents (the
                                           -------
"Co-Agents"), and BANK OF AMERICA, N.A. (formerly known as NationsBank, N.A.),
 ---------
as Administrative Lender for the Lenders (in said capacity, the "Administrative
                                                                 --------------
Lender").
------

                                  BACKGROUND
                                  ----------

         A.  The Borrower, the Lenders, the Co-Agents, and the Administrative
         Lender are parties to that certain Third Amended and Restated Credit
         Agreement, dated as of March 10, 1999, as amended by that certain First
         Amendment to Third Amended and Restated Credit Agreement, dated as of
         May 25, 2001 (said Third Amended and Restated Credit Agreement, as
         amended, the "Credit Agreement"; the terms defined in the Credit
                       ----------------
         Agreement and not otherwise defined herein shall be used herein as
         defined in the Credit Agreement).

         B.  The Borrower, the Lenders, the Co-Agents, and the Administrative
Lender desire to amend the Credit Agreement.

         NOW, THEREFORE, in consideration of the covenants, conditions and
agreements hereinafter set forth, and for other good and valuable consideration,
the receipt and adequacy of which are all hereby acknowledged, the Borrower, the
Lenders, the Co-Agents, and the Administrative Lender covenant and agree as
follows:

         1.  AMENDMENTS.
             ----------

         (a) Section 1.1 of the Credit Agreement is hereby amended by adding the
             -----------
defined term "Collateral Period" thereto in proper alphabetical order to read as
              -----------------
follows:

             "Collateral Period" means the period from and including the date
              -----------------
         which is 30 days after the date of the occurrence during the Qualifying
         Period of an Event of Default of which the Borrower has actual notice
         through and including the last day of the Qualifying Period.

         (b) Section 1.1 of the Credit Agreement is hereby amended by amending
             -----------
clause (a) in the definition of "Permitted Liens" to read as follows:
                                 ---------------

             (a) any Lien in favor of the Lenders (or the Collateral Agent)
         to secure the Obligations hereunder, and any Lien granted in favor of
         the Collateral Agent for the benefit of the Lender Secured Parties and
         the Senior Noteholders pursuant to any Pledge Agreement;

         (c) Section 5.12 of the Credit Agreement is hereby amended to read as
             ------------
follows:

             Section 5.12 Material Subsidiary. If any Subsidiary becomes a
                          -------------------
         Material Subsidiary during the Collateral Period, (a) the Capital Stock
         of such Subsidiary shall be pledged pursuant to a Pledge Agreement and
         (b) the Lenders shall receive such board resolutions and opinions of
         counsel as the Administrative Lender shall reasonably request in
         connection with the actions described in clause (a) above.

         (d) Section 7.9 of the Credit Agreement is hereby amended to read as
             -----------
follows:

             Section 7.9 Leverage Ratio. The Borrower shall not permit the
                         --------------
         Leverage Ratio to exceed (a) 4.40 to 1 at August 31, 2001, (c) 4.25 to
         1 at November 30, 2001, (d) 3.90 to 1 at February 28, 2002 or (e) 3.50
         to 1 at the end of any fiscal quarter thereafter.

                                      38-1
<PAGE>

         (e) The reference to "Qualifying Period" in subclause (ii) of clause
                               -----------------
(f) of Section 7.15 of the Credit Agreement is hereby amended to refer to
       ------------
"Collateral Period".
 -----------------

         (f) Section 8.1(p) of the Credit Agreement is hereby amended to read as
             --------------
follows:

             (p) Collateral Document. During the Collateral Period, any
                 -------------------
         Collateral Document shall for any reason (other than as expressly
         provided or permitted pursuant to the terms thereof) cease to create a
         valid and perfected first priority Lien in any Collateral in favor of
         the Collateral Agent for the ratable benefit of the Lender Secured
         Parties and the Senior Noteholders.

         (g) Section 8.1(q) of the Credit Agreement is hereby amended to read as
             --------------
follows:

             (q) Pledge Agreement and Collateral Intercreditor Agreement. (i)
                 -------------------------------------------------------
         The Borrower and its Subsidiaries shall fail to execute and deliver
         Pledge Agreements granting a Lien in all Capital Stock of the Material
         Subsidiaries by the first day of the Collateral Period, together with
         an opinion of counsel satisfactory to the Administrative Lender, stock
         certificates with respect to such Capital Stock, UCC-1 financing
         statements and other related documents requested by the Administrative
         Lender or (ii) the Collateral Intercreditor Agreement shall fail to
         have been executed and delivered by all parties thereto by the first
         day of the Collateral Period.

         (h) Section 8.2(d) of the Credit Agreement is hereby amended to read as
             --------------
follows:

             (d) Subject to the terms and provisions of the Loan Documents,
         the Administrative Lender and the Lenders may exercise all of the
         post-default rights granted to them under the Loan Documents or under
         Applicable Law, and the parties hereto agree that the taking of
         Collateral as provided herein shall not in any way limit such rights
         and remedies.

         (i) Article 11 of the Credit Agreement is hereby amended by adding a
             ----------
new Section 11.19 thereto to read as follows:
    -------------

             Section 11.19 Concerning the Pledge Agreements. The parties hereto
                           --------------------------------
         acknowledge and agree that each Pledge Agreement will contain
         provisions (a) effecting, effective on and as of the last day of the
         Collateral Period, (i) the automatic termination of such Pledge
         Agreement (except as to such provisions contained therein that are
         expressly stated therein to survive the termination thereof), (ii) the
         automatic release and termination of the Lien (with respect to both the
         Lender Secured Parties and the Senior Noteholders) in the Collateral
         granted thereunder, and (iii) the automatic release of all Collateral
         subject to the Lien thereof, and (b) authorizing and directing the
         Collateral Agent, without necessity of consent by or joinder of any
         Lender Secured Party or any Senior Noteholder, but at the sole cost and
         expense of the Borrower, in each case on the last day of the Collateral
         Period, or as soon after as is reasonably practical (i) to execute and
         deliver to the Company such instruments of release statements of
         termination as the Borrower may reasonably request in order to effect
         and evidence the releases and terminations contemplated in the
         preceding clause (a), and (ii) to deliver to, or as directed by, the
         Borrower all certificates evidencing stock or other securities then
         included in the Collateral subject to the Lien of such Pledge Agreement
         that are then in the possession of the Collateral Agent. The parties
         hereto further acknowledge and agree that any release or termination of
         any Pledge Agreement (and the Lien thereof) and the corresponding
         release of Collateral pledged thereunder that is effected on and as of,
         and by reason of the occurrence of, the last day of the Collateral
         Period and in accordance with the provisions of such Pledge Agreement
         is and shall be authorized under, and, for all purposes of this
         Agreement, shall be deemed to be made and effected pursuant to, this
         Agreement.

         (j) Exhibit D is here by amended to be in the form of Exhibit D to this
             ---------                                         ---------
Second Amendment.

                                      38-2
<PAGE>

         2.  COLLATERAL. The Borrower acknowledges its agreement to, no later
             ----------
than the first day of the Collateral Period, grant a first priority Lien, and to
cause each of its Subsidiaries to grant a first priority Lien, in the Capital
Stock of the Material Subsidiaries for the ratable benefit of the Lender Secured
Parties and the Senior Noteholders pursuant to the Pledge Agreements.

         3.  REPRESENTATIONS AND WARRANTIES TRUE; NO EVENT OF DEFAULT. By its
             --------------------------------------------------------
execution and delivery hereof, the Borrower represents and warrants that, as of
the date hereof and after giving effect to the amendments contemplated by the
foregoing Section 1:

         (a) the representations and warranties contained in the Credit
     Agreement and the other Loan Documents are true and correct on and as of
     the date hereof as made on and as of such date;

         (b) no event has occurred and is continuing which constitutes a Default
     or an Event of Default;

         (c) the Borrower has full power and authority to execute and deliver
this Second Amendment, and this Second Amendment and the Credit Agreement, as
amended hereby, constitute the legal, valid and binding obligations of the
Borrower or its Subsidiaries, as the case may be, enforceable in accordance with
their respective terms, except as enforceability may be limited by applicable
debtor relief laws and by general principles of equity (regardless of whether
enforcement is sought in a proceeding in equity or at law) and except as rights
to indemnity may be limited by federal or state securities laws;

         (d) neither the execution, delivery and performance of this Second
Amendment or the Credit Agreement, as amended by this Second Amendment, nor the
consummation of any transactions herein or therein will contravene or conflict
with any law to which the Borrower or any of its Subsidiaries is subject or any
indenture, agreement or other instrument to which the Borrower or any of its
Subsidiaries or any of their respective property is subject; and

         (e) no authorization, approval, consent, or other action by, notice to,
or filing with, any governmental authority or other Person not already obtained
is required for the execution, delivery or performance by the Borrower of this
Second Amendment, or the acknowledgment by any Guarantor of this Second
Amendment.

         4.  CONDITIONS OF EFFECTIVENESS. This Second Amendment shall be
             ---------------------------
effective as of August 20, 2001, subject to the following:

         (a) the Administrative Lender shall have received counterparts of this
Second Amendment executed by the Determining Lenders;

         (b) the Administrative Lender shall have received counterparts of this
Second Amendment executed by the Borrower and acknowledged by each Guarantor;
and

         (c) the Administrative Lender shall have received, in form and
substance satisfactory to the Administrative Lender and its counsel, such other
documents, opinions, certificates and instruments as the Administrative Lender
shall require.

Delivery by the Administrative Lender of a counterpart of this Second Amendment
executed by the Determining Lenders shall evidence the satisfaction of the
foregoing conditions and the effectiveness of this Second Amendment.

         5.  WORK FEE. The Borrower covenants and agrees to pay a work fee to
             --------
the Lenders which execute and deliver this Second Amendment to the
Administrative Lender (or its counsel) on or before the later to occur of (a)
August 20, 2001, and (b) the date on which this Second Amendment becomes
effective, in an amount equal to $5,000 for each Lender. Such work fee shall be
paid in immediately available funds and shall be due and payable to each Lender
eligible for payment pursuant to the preceding sentence no later than one
Business Day after the date on which this Second Amendment becomes effective.
The Borrower agrees that the failure to pay the work fee provided in this
Section 5 shall be an Event of Default under Section 8.1(b)(i) of the Credit
                                             -----------------
Agreement.

                                      38-3
<PAGE>

         6.   GUARANTOR'S ACKNOWLEDGMENT. By signing below, each of the
              --------------------------
Guarantors (i) acknowledges, consents and agrees to the execution, delivery and
performance by the Borrower of this Second Amendment, (ii) acknowledges and
agrees that its obligations in respect of its Subsidiary Guaranty are not
released, modified, impaired or affected in any manner by this Second Amendment
or any of the provisions contemplated herein, (iii) ratifies and confirms its
obligations under its Subsidiary Guaranty and (iv) acknowledges and agrees that
it has no claims or offsets against, or defenses or counterclaims to, its
Subsidiary Guaranty.

         7.   REFERENCE TO THE CREDIT AGREEMENT.
              ----------------------------------

         (a)  Upon the effectiveness of this Second Amendment, each reference in
the Credit Agreement to "this Agreement", "hereunder", or words of like import
shall mean and be a reference to the Credit Agreement, as affected and amended
hereby.

         (b)  The Credit Agreement, as amended by the amendments referred to
above, shall remain in full force and effect and is hereby ratified and
confirmed.

         8.   COSTS, EXPENSES AND TAXES. The Borrower agrees to pay on demand
              -------------------------
all costs and expenses of the Administrative Lender in connection with the
preparation, reproduction, execution and delivery of this Second Amendment and
the other instruments and documents to be delivered hereunder (including the
reasonable fees and out-of-pocket expenses of counsel for the Administrative
Lender with respect thereto and with respect to advising the Administrative
Lender as to its rights and responsibilities under the Credit Agreement, as
hereby amended).

         9.   EXECUTION IN COUNTERPARTS. This Second Amendment may be executed
              -------------------------
in any number of counterparts and by different parties hereto in separate
counterparts, each of which when so executed and delivered shall be deemed to be
an original and all of which when taken together shall constitute but one and
the same instrument. For purposes of this Second Amendment, a counterpart hereof
(or signature page thereto) signed and transmitted by any Person party hereto to
the Administrative Lender (or its counsel) by facsimile machine, telecopier or
electronic mail is to be treated as an original. The signature of such Person
thereon, for purposes hereof, is to be considered as an original signature, and
the counterpart (or signature page thereto) so transmitted is to be considered
to have the same binding effect as an original signature on an original
document.

         10.  GOVERNING LAW; BINDING EFFECT. This Second Amendment shall be
              -----------------------------
governed by and construed in accordance with the laws of the State of Texas and
shall be binding upon the Borrower and each Lender and their respective
successors and assigns.

         11.  HEADINGS. Section headings in this Second Amendment are included
              --------
herein for convenience reference only and shall not constitute a part of this
Second Amendment for any other purpose.

         12.  ENTIRE AGREEMENT. THE CREDIT AGREEMENT, AS AMENDED BY THIS SECOND
              ----------------
AMENDMENT, AND THE OTHER LOAN DOCUMENTS REPRESENT THE FINAL AGREEMENT BETWEEN
THE PARTIES AND MAY NOT BE CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS,
OR SUBSEQUENT ORAL AGREEMENTS BETWEEN THE PARTIES. THERE ARE NO ORAL UNWRITTEN
AGREEMENTS BETWEEN THE PARTIES.

================================================================================
                  REMAINDER OF PAGE LEFT INTENTIONALLY BLANK
================================================================================

                                      38-4
<PAGE>

     IN WITNESS WHEREOF, the parties hereto have executed this Second Amendment
as of the date above written.

                                       TEXAS INDUSTRIES, INC.




                                       By:   /s/    Kenneth R. Allen
                                             -----------------------------------
                                             Name:  Kenneth R. Allen
                                             Title: Vice President and Treasurer

                                      38-5