Exhibit 4.7 THIRD AMENDMENT TO SIXTH AMENDED AND RESTATED LOAN AND SECURITY AGREEMENT THIS THIRD AMENDMENT TO SIXTH AMENDED AND RESTATED LOAN AND SECURITY AGREEMENT (the "Amendment"), dated as of July 5, 2000, is made by and among HALIFAX CORPORATION, a Virginia corporation (the "Company"), HALIFAX ENGINEERING, INC., a Virginia corporation ("Engineering") and HALIFAX REALTY, INC., a Virginia corporation ("Realty," and together with the Company and Engineering, collectively, the "Borrowers"), and SunTrust BANK, a Georgia banking corporation, successor by merger to CRESTAR BANK (the "Lender"). RECITALS The Borrowers and the Lender are parties to the Sixth Amended and Restated Loan and Security Agreement, dated as of September 1, 1999, as amended by the First Amendment to Sixth Amended and Restated Loan and Security Agreement, dated as of September 30, 1999 and by the Second Amendment to Sixth Amended and Restated Loan and Security Agreement, dated as of December 21, 1999 (as further amended, modified or supplemented from time to time, the "Loan Agreement"). By virtue of the closing of the HTSI Sale, Technical is no longer a party to the Loan Documents. Capitalized terms defined in the Loan Agreement and undefined herein shall have the same defined meanings when such terms are used in this Amendment. The Company is in default of the financial covenant contained in Section 6.11(c) of the Loan Agreement for the Company's fiscal quarter ended on March 31, 2000 (the "Net Profit Covenant Default"). The Borrowers have requested that the Lender waive the Net Profit Covenant Default and amend certain provisions of the Loan Agreement. The Lender has agreed to do so, subject to the terms and conditions hereof. Accordingly, for valuable consideration, the receipt and sufficiency of which are acknowledged, the Borrowers and the Lender agree as follows: AMENDMENT Notwithstanding anything to the contrary contained in the Loan Documents, the Lender waives its right to declare an Event of Default under the Loan Documents as a result of the Net Profit Covenant Default. The parties hereto acknowledge and agree that the foregoing sentence shall not constitute a waiver, either express or implied, of any other default, covenant, term or provision of the Loan Documents, nor shall it create any obligation of the Lender to waive any existing or future default or violation of any other covenant, term or provision of the Loan Documents. The parties hereto agree that Lender shall be entitled to require strict compliance by the Borrowers with the Loan Documents, notwithstanding the limited express waiver and amendment contained herein, and this waiver and amendment shall not be deemed to establish a course of action or a course of dealing with respect to requests by the Borrowers for a waiver or amendment of any default, covenant, term or provision of any Loan Document. The Loan Agreement is amended as follows: The Termination Date is extended to July 1, 2001. The Maximum Amount is permanently reduced to $6,000,000. The Borrowers shall prepay the Revolving Loans to the extent that the aggregate amount of outstanding Revolving Loans and Letters of Credit exceeds the Maximum Amount (as reduced hereby), the Borrowing Base or both. On the date of this Agreement, the Borrowers shall make a $425,000 principal prepayment (the "$425,000 Curtailment") of Term Loan Two and Term Loan One (with such amount being applied first to Term Loan Two and then to Term Loan One). The parties hereto acknowledge and agree that upon payment by the Borrowers of the $425,000 Curtailment, the $125,000 installment of Term Loan One and Term Loan Two due June 15, 2000 will be deemed to be paid in full. Upon the first to occur of (a) July 20, 2000 or (b) the date of availability for application to the Obligations of funds of the Borrowers in an amount not less than $650,000 theretofore held in any cash collateral account maintained with the Lender and securing any Letter of Credit (or the date of receipt of such funds from the purchaser of Technical pursuant to the HTSI Sale, if such cash collateral cannot be made available for such application), the Borrowers shall make an additional $450,000 principal prepayment of Term Loan Two and Term Loan One (with such amount being applied first to Term Loan Two and then to Term Loan One). On or before August 1, 2000, the Borrowers shall make an additional $200,000 principal prepayment of Term Loan Two and Term Loan One (with such amount being applied first to Term Loan Two and then to Term Loan One). The Borrowers shall prepay Term Loan Two and Term Loan One (with such amount being applied first to Term Loan Two and then to Term Loan One) in an amount equal to 50% of the proceeds received by the Borrowers with respect to any Recoveries, including without limitation Recoveries arising from the settlement of claims of the Borrowers against Ernst & Young, LLP ("E&Y") in connection with, relating to or arising from the Embezzlement, with each such prepayment being made promptly upon receipt by the Borrowers of the applicable Recoveries. The Borrowers agree that the Lender has the right (but not the obligation) to provide written notice to E&Y of the Borrowers' assignment of such percentage of such Recoveries, which notice may direct E&Y to pay such percentage of such Recoveries directly to the Lender. Notwithstanding anything to the contrary contained in the Loan Agreement or any other Loan Document, the Borrowers shall furnish to the Lender not later than the date of this Amendment the current draft of the Company's Form 10-K Annual Report for the Company's fiscal year ended on March 31, 2000, to be filed with the Securities and Exchange Commission (the "Draft 10-K"). The Draft 10-K shall be in form and substance satisfactory to the Lender in its sole discretion. Notwithstanding anything to the contrary contained in the Loan Agreement or any other Loan Documents, as soon as available and in any event not later than July 31, 2000, the Borrowers shall furnish the Lender with consolidated and consolidating balance sheets, income statements and cash flows of the Borrowers setting forth projections for each fiscal quarter of the Company's fiscal year ending on March 31, 2001, and setting forth in reasonable detail the assumptions underlying such projections. The Borrowers shall pay to the Lender a closing fee in the aggregate amount of $100,000, the first $50,000 of which (the "First Installment") shall be due and payable on the date of this Amendment and the remaining $50,000 of which (the "Second Installment") shall be due and payable on August 1, 2000. Notwithstanding the foregoing, the Second Installment shall not be due and payable, and the closing fee shall be limited to the First Installment, if all outstanding Obligations evidenced by Term Note One and Term Note Two are paid in full by the Borrowers to the Lender on or before August 1, 2000. In addition, if all Obligations have not been paid in full by the Borrowers to the Lender by January 1, 2001, the Borrowers shall pay to the Lender, on January 2, 2001 and on the first day of each calendar month thereafter until all Obligations have been paid in full, an availability fee in an amount equal to $25,000 per month. The payment to the Lender by the Borrowers of the Revolving Loan prepayment described in Paragraph 2(b) of this Amendment, the $425,000 Curtailment and the First Installment shall be conditions precedent to the effectiveness of this Amendment. In addition, receipt, review and approval by the Lender of the Draft 10-K shall be a condition precedent to the effectiveness of this Amendment. Except for the amendments to the Loan Agreement set forth above, the Loan Documents shall remain in full force and effect. The Borrowers acknowledge and agree that each reference in the Loan Documents to the Termination Date shall be deemed to be a reference to such Termination Date as extended hereby, each reference in the Loan Documents to the Maximum Amount shall be deemed to be a reference to such Maximum Amount as reduced hereby and each reference in the Loan Documents to any particular Loan Document shall be deemed to be a reference to such Loan Document as amended hereby. The Borrowers acknowledge and agree that this Amendment only amends the terms of the Loan Agreement and is not a novation, and the Borrowers ratify and confirm the remaining terms and provisions of the Loan Documents in all respects. The Borrowers acknowledge and agree that the prior grant of a security interest in the Collateral continues to secure the Obligations, is in full force and effect, and is ratified and confirmed by the Borrowers in all respects. Nothing in this Amendment shall require the Lender to grant any further amendments to the terms of the Loan Documents. Each Borrower represents and warrants that this Amendment has been duly authorized, executed and delivered by it in accordance with resolutions adopted by its board of directors. All other representations and warranties made by the Borrowers in the Loan Documents are incorporated by reference in this Amendment and are deemed to have been repeated as of the date of this Amendment with the same force and effect as if set forth in this Amendment, except that any representation or warranty relating to any financial statements shall be deemed to be applicable to the financial statements most recently delivered to the Lender in accordance with the provisions of the Loan Documents. This Amendment shall be governed by the laws of the Commonwealth of Virginia, without reference to conflict of laws principles. This Amendment may be executed by the parties individually or in any combination, in one or more counterparts, each of which shall be an original and all of which together constitute one and the same instrument. [SIGNATURES ON FOLLOWING PAGE] WITNESS the following signatures. LENDER: SunTrust BANK, a Georgia banking corporation, successor by merger to CRESTAR BANK By: ___________________________ Timothy J. Duggan Senior Vice President BORROWERS: HALIFAX CORPORATION, a Virginia corporation By: _____________________________ Name: ___________________________ Title: ____________________________ HALIFAX ENGINEERING, INC., a Virginia corporation By: _____________________________ Name: ___________________________ Title: ____________________________ HALIFAX REALTY, INC., a Virginia corporation By: _____________________________ Name: ___________________________ Title: ____________________________