<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