SECOND AMENDMENT TO CREDIT AGREEMENT This SECOND AMENDMENT TO CREDIT AGREEMENT (this "Second Amendment") is entered into as of May 23, 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") and CINIZA PRODUCTION COMPANY, a New Mexico corporation ("Ciniza") (Arizona, Exploration, San Juan, Corners and Ciniza 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 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 Initial Agreement, as amended by the First 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 increase the Facility A Commitments to the aggregate amount of $70,000,000, to extend the Facility A Termination Date and the Facility B Termination Date and to further 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 modifications; 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. (a) AMENDMENTS TO ARTICLE I. ARTICLE I of the Credit Agreement is hereby amended in the following respects: (i) The definition of "CONSOLIDATED FUNDED INDEBTEDNESS" set forth in ARTICLE I of the Credit Agreement is hereby amended to read as follows: "CONSOLIDATED FUNDED INDEBTEDNESS" means, for the Company and its Consolidated Subsidiaries, at any time, without duplication, the sum of: (a) liability for borrowed money or for the deferred purchase price of property or services, (b) obligations under leases which in accordance with GAAP should be recorded as Capital Leases, (c) obligations to redeem or purchase any stock or other equity security of the Company or a Subsidiary, and (d) any guaranty obligations in respect of any of the foregoing. (ii) The definition of "CONSOLIDATED INTEREST EXPENSE" set forth in ARTICLE I of the Credit Agreement is hereby amended to read as follows: "CONSOLIDATED INTEREST EXPENSE" means for the relevant period, for the Company and its Consolidated Subsidiaries, without duplication, the sum of: (a) all interest in respect of Indebtedness and all lease payments with respect to Capital Leases accrued or capitalized during such period (whether or not actually paid during such period and including fees payable in respect of letters of credit and bankers acceptances), (b) the net amount payable (or minus the net amount receivable) under all Swap Contracts during such period (whether or not actually paid or received during such period), and (c) all dividends paid, declared or otherwise accrued in respect of preferred stock. (iii) The definition of "ELIGIBLE REFINERY HYDROCARBON INVENTORY" set forth in ARTICLE I of the Credit Agreement is hereby amended to read as follows: "ELIGIBLE REFINERY HYDROCARBON INVENTORY" means, at any date, the aggregate value therefor on a FIFO basis calculated in accordance with GAAP of all readily marketable, saleable and useful Feedstocks, Intermediate Products and Refined Products, owned by the Company and its Subsidiaries in field production tanks, storage tanks and lines (including line fills but excluding basic sediment and water and slop oil) stored on or required for the Bloomfield Refinery, the Ciniza Refinery, the Portales Refinery, the Company s or its Subsidiaries service stations and travel centers, cardlock fueling stations or bulk plants, the Albuquerque Terminal and other Refined Products terminals owned or leased by the Company or its Subsidiaries." (iv) The definitions of "FACILITY A TERMINATION DATE" and "Facility B Termination Date" set forth in ARTICLE I of the Credit Agreement are amended to read as follows: "FACILITY A TERMINATION DATE" and "FACILITY B TERMINATION DATE" means the earlier of (a) May 23, 2000, or (b) the date on which such Facility s Commitment terminates in accordance with the provisions of this Agreement. (v) The definition of "INDEX DEBT RATING" set forth in ARTICLE I of the Credit Agreement is hereby amended to read as follows: "INDEX DEBT RATING" means the rating applicable to the Company s senior, unsecured, non-credit enhanced public long term indebtedness for borrowed money, or if the Company has no such rating, the "Index Debt Rating" shall be developed by adding two debt rating levels to the rating applicable to the Company s existing Senior Subordinated Debt. (vi) The following new definitions are hereby added to ARTICLE I of the Credit Agreement: "CAPITAL LEASE" means a capital lease as determined in accordance with GAAP. "PHOENIX ACQUISITION" means the acquisition of stock of Phoenix Fuel Co., Inc. by the Company or by Giant Industries Arizona, Inc. that complies with the following: (i) such acquisition is pursuant to the terms of the Stock Purchase Agreement dated as of April 30, 1997 by and among Phoenix Fuel Co., Inc., J.W. Wilhoit, Trustee, the other Trustees and Custodian therein named, and Giant Industries Arizona, Inc., as may be amended (provided that any material amendment shall require consent of the Majority Banks), and (ii) the terms and conditions of such acquisition shall comply with all material federal, state and local laws and regulations, including, but not limited to, compliance with the Hart Scott Rodino Act and all other applicable laws and regulations. "SECOND AMENDMENT CLOSING DATE" means May 23, 1997. "THRIFTWAY ACQUISITION" means the acquisition of assets by the Company or by Giant Four Corners, Inc. from Thriftway Marketing Corp. and Clayton Investment Company and their affiliates and related companies that complies with the following: (i) such acquisition is pursuant to the terms of the Definitive Agreement dated April 18, 1997 by and between Giant Four Corners, Inc., Thriftway Marketing Corp. and Clayton Investment Company, and the associated purchase and sale agreements as provided therein, as may be amended (provided that any material amendment shall require consent of the Majority Banks), and (ii) the terms and conditions of such acquisition shall comply with all material federal, state and local laws and regulations, including, but not limited to, compliance with the Hart Scott Rodino Act and all other applicable laws and regulations. (b) AMENDMENTS TO ARTICLE II. ARTICLE II of the Credit Agreement is hereby amended in the following respects: (i) SECTION 2.05 is hereby deleted therefrom and the following SECTION 2.05 is substituted in lieu thereof: "2.05 TERMINATION OR REDUCTION OF COMMITMENTS. (a) VOLUNTARY TERMINATION OR REDUCTION. The Company may, upon not less than five Business Days prior notice to the Agent, terminate the Commitments, or permanently reduce the Commitments by an aggregate minimum amount of $2,000,000.00 or any multiple of $1,000,000.00 in excess thereof; UNLESS, after giving effect thereto and to any prepayments of Loans made on the effective date thereof, (i) the Effective Amount of all Facility A Revolving Loans exceeds the amount of the combined Facility A Revolving Commitment, then in effect, or (ii) the Effective Amount of all Facility B Revolving Loans and L/C Obligations together would exceed the amount of the combined Facility B Revolving Commitments then in effect. Once reduced in accordance with this subsection, the Commitments may not be increased. (b) MANDATORY REDUCTION. The Commitment of each Bank under the Facility A Commitment shall be automatically reduced on the second anniversary of the Second Amendment Closing Date, and such reduction shall be equal to $20,000,000.00 in the aggregate. (c) ADDITIONAL PROVISIONS. Each reduction in aggregate Commitments pursuant to paragraph (a) or (b) above shall be applied to each Bank according to its Pro Rata Share. All accrued Commitment Fees on the amount of the Commitments so terminated or reduced, Letter of Credit Fees, and Fronting Fees to, but not including, the effective date of any reduction or termination of Commitments, shall be paid by the Company on the effective date of such reduction or termination." (c) AMENDMENTS TO ARTICLE V. ARTICLE V of the Credit Agreement is hereby amended in the following respects: (i) SECTION 5.02 is hereby redesignated as SECTION 5.03; and (ii) The following shall be inserted as SECTION 5.02: "5.02 SPECIAL CONDITIONS PRECEDENT FOR FACILITY A ACQUISITIONS. The obligation of each Bank to make any Revolving Loan under Facility A, if the proceeds of such Revolving Loan are to be used to make an Acquisition involving a purchase price of $10 million or more, is subject to the satisfaction of the following conditions precedent on the relevant Borrowing Date: (a) DUE DILIGENCE. The Agent and the Banks shall have completed normal and customary due diligence, review and approval of the environmental exposures resulting from such acquisition of the Company and its existing and prospective Subsidiaries. (b) COMPLIANCE. The Acquisition shall be permissible under this Agreement. The terms and conditions of such Acquisition shall comply with all material federal, state, and local laws and regulations, including, but not limited to, compliance with the Hart-Scott-Rodino Antitrust Improvements Act and all other applicable laws and regulations, and if requested by the Agent or the Majority Banks, the Company shall furnish an opinion of counsel reasonably satisfactory to the Agent and the Majority Banks confirming the foregoing." (d) AMENDMENTS TO ARTICLE VI. ARTICLE VI of the Credit Agreement is hereby amended in the following respect: the following new sentence shall be added to the end of Section 6.08: "Margin Stock does not constitute more than 25% of the value of the consolidated assets of the Company and its Subsidiaries, and the Company does not have any present intention that Margin Stock will constitute more than 25% of the value of such assets." (e) AMENDMENTS TO ARTICLE VII. ARTICLE VII of the Credit Agreement is hereby amended in the following respects: (i) SECTION 7.13 of the Credit Agreement is hereby deleted therefrom and the following SECTION 7.13 is substituted in lieu thereof: "7.13 Use of Proceeds. The Company may use the proceeds of the Facility A Revolving Loan only for the following: (a) to make capital contributions or loans to the Giant Four Corners, Inc. to be used to finance the purchase of assets pursuant to the Thriftway Acquisition, and to make a capital contribution or loan to Giant Industries Arizona, Inc. to finance the purchase of stock pursuant to the Phoenix Acquisition, (b) to repurchase shares of capital stock of the Company to the extent such repurchases are permitted under SECTION 8.09, and (c) to make capital contributions and loans to the Guarantors for capital expenditures, for general corporate purposes and for Acquisitions permitted under this Agreement; provided, however, that the Facility A Revolving Loan shall not be used by the Company or by the Guarantors for working capital expenditures unless all Banks consent. The Company shall use the proceeds of the Facility B Revolving Loan to make capital contributions and loans to the Guarantors for working capital expenditures, and for issuance of standby letters of credit pursuant to Article III hereof in the ordinary course of business." (f) AMENDMENTS TO ARTICLE VIII. ARTICLE VIII of the Credit Agreement is hereby amended in the following respects: (i) Section 8.01 of the Credit Agreement is hereby amended by changing the period (".") at the end of SECTION 8.01(j) to "; and", and adding a new SECTION 8.01(k) as follows: "(k) the Master Lease and Option Agreements described on SCHEDULE 8.05." (ii) SECTION 8.05(c) of the Credit Agreement is hereby amended to read as follows: "(c) Indebtedness described on SCHEDULE 8.05." (iii) SECTION 8.08 of the Credit Agreement is hereby amended by changing the period (".") at the end of SECTION 8.08(g) to "; and", and adding the following new SECTION 8.08(h) as follows: "(h) the guaranties described in SCHEDULE 8.05." (iv) SECTION 8.09(c) of the Credit Agreement is hereby deleted therefrom and the following SECTION 8.09(c) is substituted in lieu thereof: "(c) notwithstanding the provisions of SECTION 8.07(a)(i), the Company may purchase, redeem or otherwise acquire shares of its common stock to the extent permitted by the terms of the NBD Subordinated Indenture, provided, however, that the Company may not purchase, redeem or otherwise acquire more than 1,400,000 shares in the aggregate in addition to shares acquired prior to March 31, 1997." (v) SECTION 8.12 of the Credit Agreement is hereby deleted therefrom and the following SECTION 8.12 is substituted in lieu thereof: "SECTION 8.12 MINIMUM CONSOLIDATED NET WORTH. From and after the Closing Date, the Company will maintain at all times Consolidated Net Worth in an amount not less than the sum of (i) $109,911,691, plus (ii) 50% of Consolidated Net Income computed on a cumulative basis for the period beginning March 31, 1997 and ending on the date of determination (provided that no negative adjustment will be made in the event that Consolidated Net Income is a deficit figure for such period), plus (iii) 75% of the aggregate amount of the net assets (cash or otherwise) received by the Company from the issuance of any class of capital stock after March 31, 1997, less (iv) any allowance for non-cash write-downs, provided that such allowance on a cumulative basis shall not exceed $10,000,000.00." (vi) SECTION 8.14 of the Credit Agreement is hereby deleted therefrom and the following SECTION 8.14 is substituted in lieu thereof: "SECTION 8.14 CAPITALIZATION RATIO. From and after the Closing Date the Company shall not permit the Capitalization Ratio to be greater than 65.0% through June 30, 1998, 62.5% after June 30, 1998 up to and including June 30, 1999, and thereafter no greater than 60.0%." (g) AMENDMENT TO SCHEDULE 2.01 (COMMITMENTS). SCHEDULE 2.01 to the Credit Agreement is hereby deleted and SCHEDULE 2.01a (FACILITY A COMMITMENT) and SCHEDULE 2.01(b) (FACILITY B COMMITMENT) are hereby added to the Credit Agreement, each in the form attached to this Amendment. (h) AMENDMENT TO SCHEDULE 2.02 (PRICING). SCHEDULE 2.02 to the Credit Agreement is hereby deleted and a revised SCHEDULE 2.02 is hereby added to the Credit Agreement, in the form set forth as SCHEDULE 2.02 to this Amendment. (i) NEW SCHEDULE 8.05 (CERTAIN PERMITTED INDEBTEDNESS AND CONTINGENT OBLIGATIONS). A new SCHEDULE 8.05, in the form attached hereto as SCHEDULE 8.05, is hereby added to the Credit Agreement. 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 December 31, 1996. 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) FACILITY A AND FACILITY B NOTES. A Facility A Note and a Facility B Note executed by the Company payable to each Bank, substantially in the form attached as EXHIBIT F to the Credit Agreement (such Facility A Notes shall be in renewal, extension, increase and replacement of the Facility A Notes executed prior to the date hereof, and such Facility B Notes shall be in renewal, extension and replacement of the Facility B Notes executed prior to the date hereof); (c) RESOLUTIONS, ETC. (i) Resolutions of the board of directors of the Company and each Guarantor authorizing the transactions contemplated hereby, certified by the Secretary or an Assistant Secretary of such Person; (ii) Certificates of the Secretary or Assistant Secretary of the Company and each Guarantor certifying the names and true signatures of the officers or such Person authorized to execute, deliver and perform, this Amendment, and all other Loan Documents to be delivered by it hereunder; and (iii) amendments to Articles or certificates of incorporation and the bylaws of the Company and each Guarantor made since the Closing Date, certified by the Secretary or Assistant Secretary of the such Person; (d) GOOD STANDING. A good standing certificate for the Company and each Guarantor from the state of incorporation as of a recent date; (e) LEGAL OPINIONS. Opinions of counsel to the Company and addressed to the Agent and the Banks, substantially in the form of Exhibit "A" hereto; (f) PAYMENT OF FEES. Evidence of payment by the Company of all accrued and unpaid fees, costs and expenses owed pursuant to the Fee Letter among the Company, the Arranger and the Agent dated as of May 10, 1997; (g) 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. The Company confirms that the Facility B Notes executed prior to the date hereof remain in full force and effect. 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 AND 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 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 Company By: /s/ A. Wayne Davenport ____________________________________ Name: A. Wayne Davenport Title: Vice President & CFO GIANT INDUSTRIES ARIZONA, INC. GIANT EXPLORATION & PRODUCTION COMPANY GIANT FOUR CORNERS, INC. SAN JUAN REFINING COMPANY CINIZIA PRODUCTION COMPANY, as Guarantors By: /s/ A. Wayne Davenport ____________________________________ Name: A. Wayne Davenport in each case, as Vice President [SIGNATURES CONTINUED ON NEXT PAGE] BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, As Agent By: /s/ J. Stephen Mernick ____________________________________ J. Stephen Mernick Senior Vice President BANK OF AMERICA ILLINOIS, as a Bank and as Issuing Bank By: /s/ J. Stephen Merick ____________________________________ J. Stephen Mernick Senior Vice President [SIGNATURES CONTINUED ON NEXT PAGE] THE FIRST NATIONAL BANK OF CHICAGO By: /s/ Steven Capouch ____________________________________ Steven Capouch First Vice President [SIGNATURES CONTINUED ON NEXT PAGE] UNION BANK OF CALIFORNIA, N.A. By:____________________________________ Name: Title: