Document:

<PAGE>

                                                                    EXHIBIT 10.4

                 FIRST AMENDMENT TO CREDIT AGREEMENT AND CONSENT

         This FIRST AMENDMENT TO CREDIT AGREEMENT AND CONSENT (this "Amendment")
dated as of April 12, 2004, by and among AGCO CORPORATION, a Delaware
corporation ("AGCO"), AGCO CANADA, LTD., a Saskatchewan corporation ("Canadian
Subsidiary"), AGCO LIMITED, an English corporation ("English Subsidiary One"),
AGCO INTERNATIONAL LIMITED, an English corporation ("English Subsidiary Two"),
AGCO HOLDING B.V., a Netherlands corporation ("Netherlands Subsidiary"), AGCO
DEUTSCHLAND HOLDING LIMITED & CO. KG, a German limited partnership ("German
Subsidiary"), and VALTRA HOLDING OY, a Finnish limited liability company
("Finnish Subsidiary"; AGCO, Canadian Subsidiary, English Subsidiary One,
English Subsidiary Two, Netherlands Subsidiary, German Subsidiary and Finnish
Subsidiary are referred to herein collectively as the "Borrowers" and
individually as a "Borrower"); the lenders (the "Lenders") signatory hereto;
COOPERATIEVE CENTRALE RAIFFEISEN-BOERENLEENBANK B.A., "RABOBANK NEDERLAND",
CANADIAN BRANCH, as Canadian administrative agent for the Canadian Lenders
(together with any successor, in such capacity, the "Canadian Administrative
Agent"); and COOPERATIEVE CENTRALE RAIFFEISEN-BOERENLEENBANK B.A., "RABOBANK
NEDERLAND", NEW YORK BRANCH, as administrative agent for the Lenders (together
with any successor, in such capacity, the "Administrative Agent").

                              W I T N E S S E T H:

         WHEREAS, the Borrowers, the Administrative Agent, the Canadian
Administrative Agent, the Lenders, the Issuing Banks (as defined in the Credit
Agreement), SunTrust Bank and Morgan Stanley Senior Funding, Inc., as
Co-Syndication Agents, and CoBank, ACB and The Bank of Tokyo-Mitsubishi, Ltd.,
NY Branch, as Co-Documentation Agents, are parties to that certain Credit
Agreement dated as of December 22, 2003 (as amended, restated, supplemented or
modified from time to time, the "Credit Agreement"); and

         WHEREAS, the Borrowers have requested that certain terms and conditions
of the Credit Agreement be amended, and the Lenders, the Canadian Administrative
Agent and the Administrative Agent have agreed to the requested amendments on
the terms and conditions set forth herein;

         NOW, THEREFORE, in consideration of the premises and of the mutual
covenants and agreements contained herein, the parties hereto hereby agree that
all capitalized terms used but not defined herein shall have the meanings
ascribed to such terms in the Credit Agreement, and further agree as follows:

<PAGE>

         SECTION 1. Amendment to Section 2.5. Section 2.5 of the Credit
Agreement, Prepayments and Deposits, is hereby amended and modified by deleting
subsection 2.5(b)(i) in its entirety and by substituting the following in lieu
thereof:

                  "(i) If, at any time after the Initial Funding Date, any
                  Borrower shall (A) incur any Funded Debt (other than (1) the
                  Obligations, (2) Indebtedness under the Bridge Facility, and
                  (3) Indebtedness permitted under clauses (b), (d), (e), and
                  (g) through (j) of Section 7.1) or (B) issue any Stock (other
                  than (1) the issuance of Stock to AGCO or any Restricted
                  Subsidiary, (2) the issuance of Stock of AGCO to any employee,
                  executive, director or officer under an incentive compensation
                  program, (3) the issuance of any Stock of a Restricted
                  Subsidiary to directors of such Restricted Subsidiaries to the
                  extent the issuance thereof is required by applicable law, and
                  (4) the issuance of Stock of AGCO to the extent that the Net
                  Cash Proceeds thereof are used substantially concurrently to
                  purchase equity securities of AGCO from management, directors
                  or key employees of AGCO or any of its Subsidiaries), then one
                  hundred percent (100%) of the Net Cash Proceeds received by
                  such Borrower pursuant to clause (A) and seventy-five percent
                  (75%) of the Net Cash Proceeds received by such Borrower
                  pursuant to clause (B) shall be paid within seven (7) Business
                  Days of receipt thereof by such Borrower to the Administrative
                  Agent as a prepayment of the Loans (in either case to be
                  applied as set forth in Section 2.5(b)(xii) below).
                  Notwithstanding the foregoing, AGCO shall be permitted to
                  retain the Net Cash Proceeds from a Stock issuance or an
                  incurrence of Funded Debt (x) received at any time after the
                  Initial Funding Date by AGCO to the extent such Net Cash
                  Proceeds are concurrently used to repay the Bridge Facility,
                  and after the repayment in full of the Bridge Facility, are
                  used to repay any of the Existing 2006 Notes or the Existing
                  2008 Notes, and (y) received by AGCO within one (1) year from
                  the Initial Funding Date in an aggregate amount of up to U.S.
                  $150,000,000; provided the Bridge Facility has been repaid in
                  full or is not outstanding and AGCO has satisfied the
                  requirements of Section 5.21 as of such date. In the event
                  AGCO elects to apply Net Cash Proceeds pursuant to any of
                  clauses (x) and (y) above and such Net Cash Proceeds are from
                  the issuance of Stock and incurrence of Funded Debt
                  simultaneously or in a related transaction or series of
                  related transactions, the Net Cash Proceeds from the Stock
                  issuance shall be deemed to be applied first to the uses in
                  clauses (x) and/or (y) above and the Net Cash Proceeds from
                  the Funded Debt incurrence shall be deemed to be applied
                  thereafter to the uses in clauses (x) and/or (y) above.
                  Nothing in this Section shall authorize any Borrower to issue
                  any Stock or incur any Funded Debt except as expressly
                  permitted by this Agreement."

                                       -2-

<PAGE>

         SECTION 2. Consent. The Lenders hereby acknowledge and consent that, so
long as the Borrowers give the required notice of redemption of the Existing
2006 Notes to the trustee within one (1) Business Day of their receipt of net
proceeds from the New Senior Subordinated Notes, the Borrowers may (a) use the
net proceeds from the New Senior Subordinated Notes (and any remaining net
proceeds received on April 7, 2004 from the issuance of common stock) to repay
the Revolving Loans, and (b) reborrow the amount of such net proceeds as
Revolving Loans to redeem the Existing 2006 Notes, provided that the Borrowers
repay the Existing 2006 Notes in full no later than June 7, 2004.

         SECTION 3. Representations and Warranties. Each of AGCO and the other
Borrowers represents and warrants as follows:

                           (a)      The execution, delivery and performance by
each Borrower of this Amendment and the other transactions contemplated hereby,
are within such Borrower's corporate powers, have been duly authorized by all
necessary corporate action, and do not (i) contravene such Borrower's charter or
bylaws; (ii) violate any Applicable Law (including, without limitation, to the
extent applicable, the Securities Exchange Act of 1934, the Racketeer Influenced
and Corrupt Organizations Chapter of the Organized Crime Control Act of 1970 and
any similar statute); (iii) conflict with or result in the breach of, or
constitute a default under, any contract, loan agreement, indenture, mortgage,
deed of trust, lease or other instrument binding on or affecting any Borrower,
any of its Subsidiaries or any of their properties (including any of the
Applicable Capital Market Transaction Documents); or (iv) except for the Liens
created under the Security Documents, result in or require the creation or
imposition of any Lien upon or with respect to any of the properties of any
Borrower or any of its Subsidiaries;

                           (b)      No authorization or approval or other action
by, and no notice to or filing with, any Governmental Authority or regulatory
body or any other third party is required for the due execution, delivery or
performance by any Borrower of this Amendment and each other Loan Document
contemplated hereby to which it is or is to be a party, or for the consummation
of the transactions contemplated hereby;

                           (c)      This Amendment and each other document
required to be delivered by a Borrower hereunder has been duly executed and
delivered by each Borrower thereto, and constitutes the legal, valid and binding
obligation of each Borrower thereto, enforceable against such Borrower in
accordance with its terms;

                           (d)      The representations and warranties contained
in Article 4 of the Credit Agreement, and in each of the other Loan Documents,
are true and correct on and as of the date hereof as though made on and as of
such date, other than any such representations and warranties that, by their
terms, expressly refer to an earlier date; and

                                       -3-

<PAGE>

                           (e)      After giving effect hereto, no event has
occurred and is continuing which constitutes an Event of Default or would
constitute an Event of Default but for the requirement that notice be given or
time elapse or both.

         SECTION 4. Conditions Precedent to Effectiveness of this Amendment.
This Amendment shall be effective as of the date first set forth above when the
Administrative Agent shall have received, in form and substance satisfactory to
it, each of the following:

                           (a)      this Amendment, duly executed by the
Borrowers, the Canadian Administrative Agent and the Administrative Agent and
Lender Addenda, in the form attached hereto, duly executed by the Required
Lenders; and

                           (b)      the delivery of such other documents,
instruments, and information, as the Administrative Agent may reasonably
request.

         SECTION 5. Reference to and Effect on the Credit Agreement. Upon the
effectiveness of this Amendment as set forth in Section 4 hereof, on and after
the date hereof, each reference in the Credit Agreement to "this Agreement",
"hereunder", "hereof", "herein" or words of like import shall mean and be a
reference to the Credit Agreement as amended hereby, and each reference in the
Notes and the other Loan Documents to the Credit Agreement shall mean and be a
reference to the Credit Agreement as amended hereby.

         SECTION 6. Costs, Expenses and Taxes. The Borrowers agree, jointly and
severally, to pay on demand all costs and expenses of the Administrative Agent
in connection with the preparation, execution and delivery of this Amendment and
the other instruments and documents to be delivered hereunder (including,
without limitation, the fees and expenses of counsel for the Administrative
Agent with respect thereto).

         SECTION 7. No Other Amendments. Except as otherwise expressed herein,
the execution, delivery and effectiveness of this Amendment shall not operate as
a waiver of any right, power or remedy of the Agents or the Lenders under the
Credit Agreement, or any of the other Loan Documents, nor constitute a waiver of
any provision of the Credit Agreement or any of the other Loan Documents. Except
for the amendment set forth above, the text of the Credit Agreement and all
other Loan Documents shall remain unchanged and in full force and effect and the
Borrowers hereby ratify and confirm their respective obligations thereunder.
This Amendment shall not constitute a modification of the Credit Agreement or a
course of dealing with the Administrative Agent at variance with the Credit
Agreement such as to require further notice by the Administrative Agent to
require strict compliance with the terms of the Credit Agreement and the other
Loan Documents in the future, except as expressly set forth herein. The
Borrowers acknowledge and expressly agree that the Agents and the Lenders
reserve the right to, and do in fact, require strict compliance with all terms
and provisions of the Credit Agreement and the other Loan Documents (in each
case as amended hereby).

                                       -4-

<PAGE>

         SECTION 8. Execution in Counterparts. This Amendment may be executed in
any number of counterparts, each of which when so executed and delivered shall
be deemed to be an original and all of which taken together shall constitute but
one and the same instrument. Delivery of a signature page hereto by facsimile
transmission or via email transmission of an Adobe portable document format file
(also known as a "PDF File") shall be as effective as delivery of a manually
executed counterpart hereof.

         SECTION 9. Delivery of Lender Addenda. Each Lender executing this
Amendment shall do so by delivering to the Administrative Agent a Lender
Addendum, substantially in the form of Annex I attached hereto, duly executed by
such Lender.

         SECTION 10. Governing Law. This Amendment shall be governed by, and
construed in accordance with, the laws (without giving effect to the conflicts
of laws principles thereof) of the State of New York.

         SECTION 11. Final Agreement. This Amendment represents the final
agreement between the Borrowers, the Administrative Agent, the Canadian
Administrative Agent and the Lenders as to the subject matter hereof 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. The Amendment shall constitute a Loan Document for all purposes.

               [The remainder of the page is intentionally blank.]

                                       -5-

<PAGE>

         IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
executed by their respective officers thereunto duly authorized, as of the date
first above written.

BORROWERS:

                                AGCO CORPORATION

                                By: -s- DAVID K WILLIAMS
                                    ---------------------------------
                                Title: VP- TREASURER

                                AGCO CANADA, LTD.

                                By: -s- DAVID K WILLIAMS
                                    ---------------------------------
                                Title: VP- TREASURER

                                AGCO LIMITED

                                By: -s-  CSD LUPTON     R.N. BATKIN
                                    ---------------------------------
                                Title: ______________________________

                                AGCO INTERNATIONAL LIMITED

                                By: -s-  CSD LUPTON     R.N. BATKIN
                                    ---------------------------------
                                Title: ______________________________

                                AGCO HOLDING B.V.

                                By: -s-  CSD LUPTON
                                    ---------------------------------
                                Title: ______________________________

                    [SIGNATURES CONTINUED ON FOLLOWING PAGE]

                       First Amendment to Credit Agreement
                                Signature Page 1

<PAGE>

                                AGCO DEUTSCHLAND HOLDING
                                LIMITED & CO. KG

                                By: -s- DAVID K WILLIAMS
                                    ---------------------------------
                                Title: VP- TREASURER

                                VALTRA HOLDING OY

                                By: -s- DAVID K WILLIAMS
                                    ---------------------------------
                                Title: VP- TREASURER

                    [SIGNATURES CONTINUED ON FOLLOWING PAGE]

                       First Amendment to Credit Agreement
                                Signature Page 2

<PAGE>

                                AGCO DEUTSCHLAND HOLDING
                                LIMITED & CO. KG

                                By: -s- R. N. Batkin
                                    ---------------------------------
                                Title:_______________________________

                                VALTRA HOLDING OY

                                By: -s- R. N. Batkin
                                    ---------------------------------
                                Title: ______________________________

                    [SIGNATURES CONTINUED ON FOLLOWING PAGE]

                       First Amendment to Credit Agreement
                                Signature Page 2

<PAGE>

AGENTS, ISSUING BANKS               COOPERATIEVE CENTRALE RAIFFEISEN-
AND SWING LINE BANK:                BOERENLEENBANK B.A., "RABOBANK
                                    NEDERLAND," NEW YORK BRANCH, as
                                    Administrative Agent and Multi-Currency
                                    Issuing Bank

                                    By: -s- Kimberly D. English
                                        ------------------------------------
                                    Title: Kimberly D. English
                                           Vice President

                                    By: -s- Brett Delfino
                                        ------------------------------------
                                    Title: Brett Delfino
                                           Executive Director

                                    COOPERATIEVE CENTRALE RAIFFEISEN-
                                    BOERENLEENBANK B.A., "RABOBANK NEDERLAND,"
                                    CANADIAN BRANCH, as Canadian Administrative
                                    Agent and Canadian Issuing Bank

                                    By: -s- DAVID L. STREETER
                                        -----------------------------------
                                    Title: DAVID L. STREETER
                                           VICE PRESIDENT

                                    By: -s- Craig Squires
                                        -----------------------------------
                                    Title: Craig Squires
                                           Vice President

LENDERS:                            See each Lender Addendum attached hereto

                       First Amendment to Credit Agreement
                                Signature Page 3

<PAGE>

                             EXECUTED LENDER ADDENDA
                      ON FILE WITH THE ADMINISTRATIVE AGENT

<PAGE>

                                     ANNEX 1

                                 LENDER ADDENDUM

                  Reference is made to the Credit Agreement dated as of December
22, 2003 (as amended, restated, renewed, supplemented or otherwise modified from
time to time, the "Credit Agreement") among AGCO Corporation, AGCO Canada Ltd.,
AGCO Limited, AGCO International Limited, AGCO Holding B.V., AGCO Deutschland
Holding Limited & Co. KG and Valtra Holding Oy (collectively, the "Borrowers"),
the lenders signatory thereto (together with any other financial institution
that subsequently becomes a Lender thereunder, the "Lenders"), the Issuing Banks
(as defined in the Credit Agreement), Cooperatieve Centrale
Raiffeisen-Boerenleenbank B.A., "Rabobank Nederland", Canadian Branch, as
Canadian Administrative Agent, SunTrust Bank and Morgan Stanley Senior Funding,
Inc., as Co-Syndication Agents, CoBank, ACB and The Bank of Tokyo-Mitsubishi,
Ltd., NY Branch, as Co-Documentation Agents, and Cooperatieve Centrale
Raiffeisen-Boerenleenbank B.A., "Rabobank Nederland", New York Branch, as the
Administrative Agent (the "Administrative Agent"). Capitalized terms used herein
without definition shall have the respective meanings ascribed to those terms in
the Credit Agreement.

                  Upon execution and delivery of this Lender Addendum by the
undersigned Lender, the undersigned Lender hereby consents to and agrees with
all of the terms and conditions contained in, and shall become a party to, the
First Amendment to Credit Agreement and Consent dated as of April 12, 2004.

                  THIS LENDER ADDENDUM SHALL BE GOVERNED BY, AND CONSTRUED AND
INTERPRETED IN ACCORDANCE WITH, THE LAW OF THE STATE OF NEW YORK.

                  This Lender Addendum may be executed by one or more of the
parties hereto on any number of separate counterparts, and all of said
counterparts taken together shall be deemed to constitute one and the same
instrument. Delivery of an executed signature page hereof by facsimile
transmission or via email transmission of an Adobe portable document file (also
known as a "PDF File") shall be effective as delivery of a manually executed
counterpart hereof.

            [The remainder of this page is intentionally left blank.]

<PAGE>

                  IN WITNESS WHEREOF, the parties hereto have caused this Lender
Addendum to be duly executed and delivered by their proper and duly authorized
officers effective as of the date set forth herein.

                                    [NAME OF LENDER]

                                    By:_________________________________
                                    Name:_______________________________
                                    Title:______________________________<PAGE>

                                                                    EXHIBIT 10.1

                 AMENDMENT NO. 2 TO REVOLVING CREDIT, TERM LOAN
                             AND SECURITY AGREEMENT

      THIS AMENDMENT NO. 2 TO REVOLVING CREDIT, TERM LOAN AND SECURITY AGREEMENT
(this "Amendment"), dated as of March 31, 2004, is entered into by and among
AMERICA SERVICE GROUP INC. ("ASG") a Delaware corporation, PRISON HEALTH
SERVICES, INC. ("PHS"), a Delaware corporation, EMSA LIMITED PARTNERSHIP ("EMSA
LP"), a Florida limited partnership, PRISON HEALTH SERVICES OF INDIANA, L.L.C.
("PHS INDIANA"), an Indiana limited liability company, CORRECTIONAL HEALTH
SERVICES, LLC ("CHS"), a New Jersey limited liability company, and SECURE
PHARMACY PLUS, LLC ("SPP"), a Tennessee limited liability company (together with
ASG, PHS, EMSA LP, PHS INDIANA, AND CHS individually and collectively,
"BORROWER"), CAPITALSOURCE FINANCE LLC, a Delaware limited liability company
("CAPITALSOURCE"), as administrative agent and collateral agent for Lenders (in
such capacities, the "AGENT"), and CapitalSource and WELLS FARGO FOOTHILL, INC.
(formerly known as FOOTHILL CAPITAL CORPORATION), as Lenders.

                                    RECITALS

      A.    Pursuant to that certain Revolving Credit, Term Loan and Security
Agreement dated as of October 31, 2002, by and between Borrower, Agent and the
other Lenders identified therein, as amended by that certain Joinder Agreement
and Amendment No. 1 to Revolving Credit, Term Loan and Security Agreement, dated
as of May 21, 2003 (as amended to date, and as amended, supplemented, modified
and restated from time to time, collectively, the "LOAN AGREEMENT"), the Lenders
agreed to make available to Borrower the Loans.

      B.    The parties hereto desire to enter into this Amendment to amend the
Loan Agreement in certain respects as provided herein.

      NOW, THEREFORE, in consideration of the foregoing, the terms and
conditions, premises and other mutual covenants set forth in this Amendment, and
other good and valuable consideration, the receipt and adequacy of which are
hereby acknowledged, Borrower, Agent and the other Lenders hereby agree as
follows:

      SECTION 1. DEFINITIONS. Unless otherwise defined herein, all capitalized
terms used and not defined herein shall have the meanings assigned to such terms
in the Loan Agreement (as amended hereby).

      SECTION 2. AMENDMENTS TO LOAN AGREEMENT. The sections, definitions,
schedules, annexes and exhibits of and to the Loan Agreement referenced and set
forth on Annex A to this Amendment hereby are amended and restated to read as
set forth on such Annex A, which annex is incorporated herein and made a part
hereof and of the Loan Agreement.

      SECTION 3. REPRESENTATIONS AND WARRANTIES.

            (a)   Notwithstanding any other provision of this Amendment, each
Borrower individually hereby (i) confirms and makes all of the representations
and warranties set forth in the Loan Agreement and other Loan Documents with
respect to such Borrower as of the date hereof and as of the Effective Date and
confirms that they are true and correct, (ii) specifically represents and
warrants to each

                                       1
<PAGE>

Lender that it has good and marketable title to all of its respective
Collateral, free and clear of any Lien or security interest in favor of any
other Person (other than Permitted Liens), (iii) specifically represents and
warrants that since the date of the last financial statements of the Borrower
provided to Agent there has been no material adverse change in the business,
operations, results of operations, assets, liabilities or financial condition of
Borrower, and (iv) specifically represents and warrants that Borrower has
delivered to Agent true, correct and complete copies of all material documents
related to the Florida Settlement.

            (b)   Each Borrower individually hereby represents and warrants as
of the date of this Amendment and as of the Effective Date as follows: (i) it is
duly incorporated or organized, validly existing and in good standing under the
laws of its jurisdiction of organization; (ii) the execution, delivery and
performance by it of this Amendment are within its powers, have been duly
authorized, and do not contravene (A) its articles of organization, operating
agreement, or other organizational documents, or (B) any applicable law; (iii)
no consent, license, permit, approval or authorization of, or registration,
filing or declaration with any Governmental Authority or other Person, is
required in connection with the execution, delivery, performance, validity or
enforceability of this Amendment by or against it; (iv) this Amendment has been
duly executed and delivered by it; (v) this Amendment constitutes its legal,
valid and binding obligations enforceable against it in accordance with its
terms, except as enforceability may be limited by applicable bankruptcy,
insolvency, reorganization, moratorium or similar laws affecting the enforcement
of creditors' rights generally or by general principles of equity; and (vi) it
is not in default under the Loan Agreement and no Default or Event of Default
exists, has occurred or is continuing.

      SECTION 4. EXPENSES. Borrower shall pay all costs and expenses incurred by
Agent, Lenders or any of its Affiliates, including, without limitation,
documentation and diligence fees and expenses, and all other out-of-pocket
charges and expenses and reasonable attorneys' fees and expenses, in connection
with entering into, negotiating, preparing, reviewing and executing this
Amendment and all related agreements, documents and instruments, and all of the
same, to the extent incurred and not promptly reimbursed by Borrower, may be
charged to Borrower's account and shall be part of the Obligations. If Agent,
any Lender or any of Agent or Lender's Affiliates uses in-house counsel for any
of the purposes set forth above Borrower expressly agrees that its Obligations
include reasonable charges for such work commensurate with the fees that would
otherwise be charged by outside legal counsel selected by such Agent or Lender
or such Affiliate in its sole discretion for the work performed.

         SECTION 5. REFERENCE TO THE EFFECT ON THE LOAN AGREEMENT. Upon the
effectiveness of this Amendment, (i) each reference in the Loan Agreement to
"this Agreement," "hereunder," "hereof," "herein" or words of similar import
shall mean and be a reference to the Loan Agreement as amended by this
Amendment, and (ii) each reference in any other Loan Document to the "Loan
Agreement" shall mean and be a reference to the Loan Agreement as amended by
this Amendment. Each reference herein to the Loan Agreement shall be deemed to
mean the Loan Agreement as amended by this Amendment. Except as specifically
amended hereby, the Loan Agreement and all other Loan Documents shall remain in
full force and effect and the terms thereof are expressly incorporated herein
and are ratified and confirmed in all respects. This Amendment is not intended
to be or to create, nor shall it be construed as or constitute, a novation or an
accord and satisfaction but shall constitute an amendment of the Loan Agreement.
The parties hereto agree to be bound by the terms and conditions of the Loan
Agreement as amended by this Amendment as though such terms and conditions were
set forth herein in full. The execution, delivery and effectiveness of this
Amendment shall not, except as expressly provided in this Amendment, operate as
a waiver of any right, power or remedy of Lender, nor constitute a waiver of any
provision of the Loan Agreement or any other Loan Document or any other
documents, instruments and agreements executed or delivered in connection
therewith or of any Default or Event of Default under any of the foregoing
whether arising before or after the Effective Date or as a result of performance
hereunder.

                                       2
<PAGE>

      SECTION 6. GOVERNING LAW AND JURY TRIAL. THIS AMENDMENT AND THE RIGHTS AND
OBLIGATIONS OF THE PARTIES UNDER THIS AMENDMENT SHALL BE GOVERNED BY AND
CONSTRUED AND INTERPRETED IN ACCORDANCE WITH THE CHOICE OF LAW PROVISIONS SET
FORTH IN THE LOAN AGREEMENT AND SHALL BE SUBJECT TO THE WAIVER OF JURY TRIAL AND
NOTICE PROVISIONS OF THE LOAN AGREEMENT.

      SECTION 7. HEADINGS AND COUNTERPARTS. The captions in this Amendment are
intended for convenience and reference only and do not constitute and shall not
be interpreted as part of this Amendment and shall not affect the meaning or
interpretation of this Amendment. This Amendment may be executed in one or more
counterparts, all of which taken together shall constitute but one and the same
instrument. This Amendment may be executed by facsimile transmission, which
facsimile signatures shall be considered original executed counterparts for all
purposes, and each party to this Amendment agrees that it will be bound by its
own facsimile signature and that it accepts the facsimile signature of each
other party to this Amendment.

      SECTION 8. AMENDMENTS. This Amendment may not be changed, modified,
amended, restated, waived, supplemented, discharged, canceled or terminated
orally or by any course of dealing or in any other manner other than by written
agreement in accordance with Section 10.5 of the Loan Agreement. This Amendment
shall be considered part of the Loan Agreement for all purposes under the Loan
Agreement.

      SECTION 9. ENTIRE AGREEMENT. This Amendment, the Loan Agreement, and the
other Loan Documents constitute the entire agreement between the parties with
respect to the subject matter hereof and thereof and supersedes all prior
discussions, representations, agreements and understandings, if any, relating to
the subject matter hereof and thereof and may not be contradicted by evidence of
prior, contemporaneous or subsequent oral agreements between the parties. There
are no unwritten oral agreements between the parties.

      SECTION 10. MISCELLANEOUS. Whenever the context and construction so
require, all words used in the singular number herein shall be deemed to have
been used in the plural, and vice versa, and the masculine gender shall include
the feminine and neuter and the neuter shall include the masculine and feminine.
This Amendment shall inure to the benefit of Agent, Lenders, all future holders
of any Note, any of the Obligations or any of the Collateral and all Transferees
and Participants, and each of their respective successors and permitted assigns.
No Borrower may assign, delegate or transfer this Amendment or any of its rights
or obligations under this Amendment unless otherwise permitted by the Loan
Documents. No rights are intended to be created under this Amendment for the
benefit of any third party donee, creditor or incidental beneficiary of Borrower
or any Guarantor. Nothing contained in this Amendment shall be construed as a
delegation to Agent or any Lender of any Borrower's or any Guarantor's duty of
performance, including, without limitation, any duties under any account or
contract in which Lender has a security interest or Lien. This Amendment shall
be binding upon Borrowers and their respective successors and assigns.

      SECTION 11. EFFECTIVE DATE. Borrower shall deliver the following documents
to Agent, in form and substance satisfactory to Agent, in its sole discretion,
and, where applicable, each duly executed by each party thereto, and this
Amendment shall be deemed to be effective on March 31, 2004 (retroactively if
applicable) (the "EFFECTIVE DATE") upon receipt by Agent of all such documents:
(i) this Amendment, duly executed by Borrower and Wells Fargo Foothill, Inc.;
(ii) a copy of all executed agreements and documents evidencing the Florida
Settlement; (iii) copies of documentation in form and substance satisfactory to
Agent evidencing the dissolution of EMSA GOVERNMENT SERVICES, INC., a Florida
corporation, EMSA CORRECTIONAL CARE, INC., a Florida corporation, and EMSA

                                       3
<PAGE>

MILITARY SERVICES, INC., a Florida corporation, and (iv) all other documents
Agent may request with respect to any matter relevant to this Amendment or the
transactions contemplated hereby, including, without limitation, all consents,
approvals and agreements from such third parties as are necessary or desirable
with respect to this Amendment and the Loan Documents executed in connection
herewith.

                        [SIGNATURES APPEAR ON NEXT PAGE]

                                       4
<PAGE>

      IN WITNESS WHEREOF, the parties have caused this Amendment No. 2 to
Revolving Credit, Term Loan and Security Agreement to be executed by their
respective officers thereunto duly authorized as of the date first written
above.

BORROWER:                            AMERICA SERVICE GROUP INC.

                                     By:   /s/ Michael Taylor
                                        ----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Chief Financial Officer

                                     PRISON HEALTH SERVICES, INC.

                                     By:   /s/ Michael Taylor
                                        -----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Senior Vice President

                                     EMSA LIMITED PARTNERSHIP,
                                     By its General Partner, EMSA CORRECTIONAL
                                     CARE, INC.

                                     By:   /s/ Michael Taylor
                                        ----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Senior Vice President

                                     PRISON HEALTH SERVICES OF INDIANA, LLC
                                     By its General Manager, PRISON HEALTH
                                     SERVICES, INC.

                                     By:   /s/ Michael Taylor
                                        -----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Senior Vice President

                                     CORRECTIONAL HEALTH SERVICES, LLC

                                     By:   /s/ Michael Taylor
                                        -----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Senior Vice President

                                       5
<PAGE>

                                     SECURE PHARMACY PLUS, LLC

                                     By:   /s/ Michael Taylor
                                        ----------------------------------
                                     Name: Mr. Michael Taylor
                                     Title: Senior Vice President

LENDER:                              WELLS FARGO FOOTHILL, INC.
                                     (formerly known as FOOTHILL CAPITAL
                                     CORPORATION)

                                     By:    /s/ Amelie Yehros
                                        --------------------------------
                                     Name:  Amelie Yehros
                                     Title: Senior Vice President

AGENT AND LENDER:                    CAPITALSOURCE FINANCE LLC

                                     By:    /s/ Steven A. Museles
                                        --------------------------------
                                     Name:  Steven A. Museles
                                     Title: Senior Vice President

                                       6
<PAGE>

                                     ANNEX A
                                       TO
                               AMENDMENT NO. 2 TO
               REVOLVING CREDIT, TERM LOAN AND SECURITY AGREEMENT

Effective as of the Effective Date (unless otherwise indicated below), the Loan
Agreement is hereby amended as follows:

      1.    AMENDMENT TO ANNEX I OF THE LOAN AGREEMENT; ADDITION OF FINANCIAL
COVENANT. Annex I is hereby amended by adding the Minimum Liquidity financial
covenant as follows:

            3)    MINIMUM LIQUIDITY

            At any time that Borrower is not in compliance with the Fixed Charge
      Coverage Ratio because of charges associated with the Florida Settlement,
      then at all times Borrower on a consolidated basis shall have not less
      than $5,000,000.00 of Available Cash on hand.

      2.    AMENDMENTS TO ANNEX I OF THE LOAN AGREEMENT; ADDITION OF CERTAIN
DEFINITIONS. Annex I is hereby amended by adding the following definitions
thereto in proper alphabetical order to read in full as follows:

            "Available Cash" shall mean, for and on any date, the sum without
      duplication of the following for Borrower: (a) unrestricted cash on hand
      on such date, (b) Cash Equivalents held on such date, and (c) the
      unborrowed Availability on and as of such date.

            "Cash Equivalents" shall mean (a) securities issued, or directly and
      fully guaranteed or insured, by the United States or any agency or
      instrumentality thereof (provided that the full faith and credit of the
      United States is pledged in support thereof) having maturities of not more
      than six months from the date of acquisition, (b) U.S. dollar denominated
      time deposits, certificates of deposit and bankers' acceptances of (i) any
      domestic commercial bank of recognized standing having capital and surplus
      in excess of $500,000,000, or (ii) any bank (or the parent company of such
      bank) whose short-term commercial paper rating from Standard & Poor's
      Ratings Services ("S&P") is at least A-2 or the equivalent thereof or from
      Moody's Investors Service, Inc. ("MOODY'S") is at least P-2 or the
      equivalent thereof in each case with maturities of not more than six
      months from the date of acquisition (any bank meeting the qualifications
      specified in clauses (b)(i) or (ii), an "APPROVED BANK"), (c) repurchase
      obligations with a term of not more than seven days for underlying
      securities of the types described in clause (a), above, entered into with
      any Approved Bank, (d) commercial paper issued by any Approved Bank or by
      the parent company of any Approved Bank and commercial paper issued by, or
      guaranteed by, any industrial or financial company with a short-term
      commercial paper rating of at least A-2 or the equivalent thereof by S&P
      or at least P-2 or the equivalent thereof by Moody's, or guaranteed by any
      industrial company with a long term unsecured debt rating of at least A or
      A2, or the equivalent of each thereof, from S&P or Moody's, as the case
      may be, and in each case maturing within six months after the date of
      acquisition and (e) investments in money market funds substantially all of
      whose assets are comprised of securities of the type described in clauses
      (a) through (d) above.

            "Florida Settlement" shall mean that agreement entered into by and
      between the State of Florida Attorney General's office and EMSA LP, on
      behalf of itself and its affiliates, regarding indirect actions, the
      subject of which have been under investigation by the Florida Attorney

                                       7
<PAGE>

      General's office for several years, which may have caused outside
      providers to bill the Medicaid program in an inappropriate manner in the
      state of Florida.

      3.    AMENDMENT TO ANNEX I OF THE LOAN AGREEMENT. The definition of EBITDA
in Annex I is hereby amended and restated and replaced in its entirety to read
as follows:

            "EBITDA" shall mean, for any Test Period, the sum, without
      duplication, of the following for Borrower, on a consolidated basis: Net
      Income determined in accordance with GAAP, plus, (a) Interest Expense, (b)
      any provision for taxes based on income or profit that was deducted in
      computing Net Income, (c) depreciation expense, (d) amortization expense,
      (e) all other non-cash, non-recurring charges and expenses, excluding
      accruals for cash expenses made in the ordinary course of business, (f)
      loss from any sale of assets, other than sales in the ordinary course of
      business, all of the foregoing determined in accordance with GAAP, and (g)
      allocated amounts attributable to the Florida Settlement which shall not
      exceed $5,000,000.00 minus (a) gains from any sale of assets, other than
      sales in the ordinary course of business, (b) other extraordinary or
      non-recurring gains, and (c) the charges against the loss contract reserve
      established on 12/31/2001.

                                       8

Source: [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00066-of-00352.parquet"}, [{"source": "alea-institute/alea-institute/kl3m-data-edgar-agreements/train-00066-of-00352.parquet"}]]