EXHIBIT 10.1 THIRD AMENDMENT TO CREDIT AGREEMENT This THIRD AMENDMENT TO CREDIT AGREEMENT (this "Third Amendment") is entered into as of August 25, 1997, among GIANT INDUSTRIES, INC., a Delaware corporation (the "Company"), GIANT INDUSTRIES ARIZONA, INC., an Arizona corporation ("Arizona"), GIANT EXPLORATION & PRODUCTION COMPANY, a Texas corporation ("Exploration"), SAN JUAN REFINING COMPANY, a New Mexico corporation ("San Juan"), GIANT FOUR CORNERS, INC., an Arizona corporation ("Corners"), CINIZA PRODUCTION COMPANY, a New Mexico corporation ("Ciniza") and PHOENIX FUEL CO., INC., an Arizona corporation ("Phoenix") (Arizona, Exploration, San Juan, Corners, Ciniza and Phoenix are individually referred to herein as a "Guarantor" and collectively as the "Guarantors"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, as Agent (the "Agent"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION (successor to Bank of America Illinois), as Issuing Bank and as a Bank, THE FIRST NATIONAL BANK OF CHICAGO (successor to NBD Bank, by assignment), as a Bank and UNION BANK OF CALIFORNIA, N.A. (formerly known as Union Bank), as a Bank. Capitalized terms which are used herein without definition and which are defined in the Credit Agreement referred to below shall have the meanings ascribed to them in the Credit Agreement. WHEREAS, the Company, the Agent and the Banks are parties to a certain Credit Agreement dated as of October 4, 1995 (the "Initial Agreement"); and WHEREAS, the Company, the Agent and the Banks are parties to a certain First Amendment to Credit Agreement dated as of May 15, 1996 (the "First Amendment"); WHEREAS, the Company, the Agent and the Banks are parties to a certain Second Amendment to Credit Agreement dated as of May 23, 1997 (the "Second Amendment"); WHEREAS, the Initial Agreement, as amended by the First Amendment and the Second Amendment, and as may be further amended and restated from time to time, is hereinafter called the "Credit Agreement;" and WHEREAS, the Company has requested that the Agent and the Banks agree to amend the Credit Agreement as herein provided; and subject to the terms hereof the Agent and the Banks are willing to agree to the Company's requested modification; NOW, THEREFORE, for good and valuable consideration, the receipt and sufficiency of which is hereby acknowledged, the parties hereto hereby agrees as follows: SECTION 1. AMENDMENTS TO THE CREDIT AGREEMENT. Article I of the Credit Agreement is hereby amended in the following respect: the definition of "Consolidated Funded Indebtedness" is hereby amended by changing the period (".") at the end of such definition to ",", and adding the following immediately thereafter: "less the portion of the sum of cash and Cash Equivalents owned by the Company and its Consolidated Subsidiaries that exceeds $10,000,000.00 (provided that such cash and Cash Equivalents are not encumbered by any Liens)." SECTION 2. REPRESENTATIONS AND WARRANTIES. The Company and each of the Guarantors represent and warrant to the Agent and to each of the Banks that: (a) This Amendment, the Credit Agreement as amended hereby and each Guaranty and each Note have been duly authorized, executed and delivered by the Company and the Guarantors who are parties thereto and constitute their legal, valid and binding obligations enforceable in accordance with their respective terms (subject, as to the enforcement of remedies, to applicable bankruptcy, reorganization, insolvency, moratorium and similar laws affecting creditors' rights generally and to general principles of equity). (b) The representations and warranties set forth in Article V of the Credit Agreement are true and correct in all material respects before and after giving effect to this Amendment with the same effect as if made on the date hereof. (c) As of the date hereof, at the time of and immediately after giving effect to this Amendment, no Default or Event of Default has occurred and is continuing. (d) No material adverse change in the business, assets, operations, financial condition, liabilities or capitalization of the Company and its Subsidiaries has occurred since June 30, 1997. SECTION 3. CONDITIONS OF EFFECTIVENESS. This Amendment shall be effective on the date (the "Effective Date") of the delivery by the Company and the Guarantors to the Agent of the following: (a) AMENDMENT. This Amendment, signed by the Company, the Guarantors, the Agent, and each of the Banks; (b) OTHER. Such other approvals, opinions and documents as the Agent or the Majority Banks may reasonably request. SECTION 4. EFFECT OF AMENDMENT. This Amendment (i) except as expressly provided herein, shall not be deemed to be a consent to the modification or waiver of any other term or condition of the Credit Agreement or of any of the instruments or agreements referred to therein and (ii) shall not prejudice any right or rights which the Agent or the Banks may now have under or in connection with the Credit Agreement, as amended by this Amendment. Except as otherwise expressly provided by this Amendment, all of the terms, conditions and provisions of the Credit Agreement shall remain the same. It is declared and agreed by each of the parties hereto that the Credit Agreement, as amended hereby, shall continue in full force and effect, and that this Amendment and such Credit Agreement shall be read and construed as one instrument. SECTION 5. GUARANTIES. Each of the Guarantors hereby consents to and accepts the terms and conditions of this Amendment, agrees to be bound by the terms and conditions hereof, and ratifies and confirms that its Guaranty executed and delivered in connection with the Credit Agreement is and remains in full force and effect. SECTION 6. MISCELLANEOUS This Amendment shall for all purposes be construed in accordance with and governed by the laws of the State of Texas. The captions in this Amendment are for convenience of reference only and shall not define or limit the provisions hereof. This Amendment may be executed in separate counterparts, each of which when so executed and delivered shall be an original, but all of which together shall constitute one instrument. In proving this Amendment, it shall not be necessary to produce or account for more than one such counterpart. [SIGNATURES BEGIN ON NEXT PAGE] NO ORAL AGREEMENTS. THE CREDIT AGREEMENT (AS AMENDED BY THE FIRST AMENDMENT, THE SECOND AMENDMENT AND THIS THIRD 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 OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS BETWEEN THE PARTIES. IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be duly executed and delivered by their proper and duly authorized officers as of the date and year first above written. GIANT INDUSTRIES, INC., as Borrower By:________________________________ Name: Title: GIANT INDUSTRIES ARIZONA, INC., GIANT EXPLORATION & PRODUCTION COMPANY, GIANT FOUR CORNERS, INC., SAN JUAN REFINING COMPANY, CINIZA PRODUCTION COMPANY, and PHOENIX FUEL CO., INC. as Guarantors By:________________________________ Name: in each case, as Vice President [SIGNATURES CONTINUED ON NEXT PAGE] BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, As Agent By:________________________________ Name: Title: BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, as a Bank and as Issuing Bank By:________________________________ Name: Title: [SIGNATURES CONTINUED ON NEXT PAGE] THE FIRST NATIONAL BANK OF CHICAGO By:________________________________ Name: Title: [SIGNATURES CONTINUED ON NEXT PAGE] UNION BANK OF CALIFORNIA, N.A. By:________________________________ Name: Title: