<PAGE>

                                                                    EXHIBIT 10.1

                 AMENDMENT NO. 3 TO REVOLVING CREDIT, TERM LOAN

                             AND SECURITY AGREEMENT

THIS AMENDMENT NO. 3 TO REVOLVING CREDIT, TERM LOAN AND SECURITY AGREEMENT (this
"AMENDMENT NO. 3"), dated as of July 25, 2005, 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 and Amendment No. 2 to Revolving Credit, Term Loan and
Security Agreement dated as of March 31, 2004 (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 and other credit facilities contemplated thereby.

      B. The parties hereto desire to enter into this Amendment No. 3 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 No.
3, and other good and valuable consideration, the receipt and adequacy of which
are hereby acknowledged, and intending to be legally bound, Borrower, Agent and
the 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. AMENDMENT TO SECTION 7.5 (DIVIDENDS, REDEMPTIONS, EQUITY) OF
THE LOAN AGREEMENT. Section 7.5 of the Loan Agreement is hereby amended so that:
(a) the word "and" appearing before the reference to clause (ii) is hereby
deleted; and (b) the following is inserted at the end of such Section 7.5,
immediately prior to the period:

                  ", and (iii) ASG may repurchase shares of its common stock in
                  any single transaction or series of transactions pursuant to a
                  Stock Repurchase Authorization (defined below), provided,
                  that, (x) the aggregate dollar amount of cash paid by ASG in
                  connection therewith does not exceed $30,000,000, (y) no
                  Default or Event of Default shall have occurred or be
                  continuing as of the effective date of any such transaction or
                  would result from any such transaction,

                                       1

<PAGE>

                  and (z) not less than three (3) Business Days prior to giving
                  effect to the initial stock repurchase contemplated by this
                  clause (iii), ASG shall have provided Agent with a copy of the
                  resolutions duly authorized by the board of directors of ASG
                  to give effect to the stock repurchase contemplated by this
                  clause (iii) (the "Stock Repurchase Authorization"), together
                  with an officer's compliance certificate demonstrating
                  compliance with the terms of the preceding subclauses (x) and
                  (y)."

      SECTION 3. REPRESENTATIONS AND WARRANTIES.

            (a) Notwithstanding any other provision of this Amendment No. 3,
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) represents and
warrants to each 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), and (iii) 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.

            (b) Each Borrower individually hereby represents and warrants as of
the date of this Amendment No. 3 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 No. 3 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 No. 3 by or against it; (iv) this Amendment No.
3 has been duly executed and delivered by it; (v) this Amendment No. 3
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 their respective 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
and allocated costs of in-house counsel, in connection with entering into,
negotiating, preparing, reviewing and executing this Amendment No. 3 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 as an Advance 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 No. 3, (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
No. 3, and (ii) each reference in any other Loan Document to the "Loan

                                        2

<PAGE>

Agreement" shall mean and be a reference to the Loan Agreement as amended by
this Amendment No. 3. Each reference herein to the Loan Agreement shall be
deemed to mean the Loan Agreement as amended by this Amendment No. 3. 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 No. 3 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 No. 3 as
though such terms and conditions were set forth herein in full. The execution,
delivery and effectiveness of this Amendment No. 3 shall not, except as
expressly provided in this Amendment No. 3, 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.

      SECTION 6. GOVERNING LAW AND JURY TRIAL. THIS AMENDMENT NO. 3 AND THE
RIGHTS AND OBLIGATIONS OF THE PARTIES UNDER THIS AMENDMENT NO. 3 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. HEADING AND COUNTERPARTS. The captions in this Amendment No. 3
are intended for convenience and reference only and do not constitute and shall
not be interpreted as part of this Amendment No. 3 and shall not affect the
meaning or interpretation of this Amendment No. 3. This Amendment No. 3 may be
executed in one or more counterparts, all of which taken together shall
constitute but one and the same instrument. This Amendment No. 3 may be executed
by facsimile transmission, which facsimile signatures shall be considered
original executed counterparts for all purposes, and each party to this
Amendment No. 3 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
No. 3.

      SECTION 8. AMENDMENTS. This Amendment No. 3 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
No.3 shall be considered part of the Loan Agreement for all
purposes under the Loan Agreement.

      SECTION 9. ENTIRE AGREEMENT. This Amendment No. 3, 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 No. 3 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
No. 3 or any of its rights or obligations under this Amendment No. 3 unless
otherwise

                                       3

<PAGE>

permitted by the Loan Documents. No rights are intended to be created under this
Amendment No. 3 for the benefit of any third party donee, creditor or incidental
beneficiary of Borrower or any Guarantor. Nothing contained in this Amendment
No. 3 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 No. 3 shall be binding upon Borrowers
and their respective successors and assigns.

      SECTION 11. EFFECTIVE DATE. The effectiveness of this Amendment No. 3 and
the agreements of Agent and Lenders set forth herein, are subject to the
satisfaction of the following conditions precedent (the date on which such
conditions shall have been satisfied, the "Effective Date"), all in form and
substance satisfactory to Agent in its sole discretion:

            (a) Agent shall have received each of the following, each in form
and substance satisfactory to Agent in its sole discretion, and, where
applicable, each duly executed by each party thereto:

                  (i) This Amendment No. 3, duly executed by an authorized
officer of each Borrower and each Lender; and

                  (ii) All other documents Agent may reasonably request with
respect to any matter

relevant to this Amendment No. 3 or the transactions contemplated hereby;

            (b) The representations and warranties contained herein, in the Loan
Agreement and the other Loan Documents, as each is amended hereby, shall be true
and correct as of the date hereof, as if made on the date hereof, except for
such representations and warranties as are by their express terms limited to a
specific date;

            (c) No Default or Event of Default shall have occurred and be
continuing; and

            (d) All corporate proceedings taken in connection with the
transactions contemplated by this Amendment No. 3 and all documents, instruments
and other legal matters incident thereto shall be satisfactory to Agent.

      SECTION 12. RELEASE BY BORROWER. BY EXECUTION OF THIS AMENDMENT NO. 3,
EACH BORROWER ACKNOWLEDGES AND CONFIRMS, ON A JOINT AND SEVERAL BASIS, THAT SUCH
BORROWER PARTY DOES NOT HAVE ANY OFFSETS, DEFENSES OR CLAIMS AGAINST AGENT OR
ANY LENDER, OR ANY OF THEIR RESPECTIVE PRESENT OR FORMER SUBSIDIARIES,
AFFILIATES, OFFICERS, DIRECTORS, SHAREHOLDERS, EMPLOYEES, AGENTS,
REPRESENTATIVES, ATTORNEYS, PREDECESSORS, SUCCESSORS OR ASSIGNS WHETHER ASSERTED
OR UNASSERTED. TO THE EXTENT THAT ANY BORROWER MAY HAVE SUCH OFFSETS, DEFENSES
OR CLAIMS, EACH BORROWER AND EACH OF ITS SUCCESSORS, ASSIGNS, PARENTS,
SUBSIDIARIES, AFFILIATES, PREDECESSORS, EMPLOYEES, AGENTS, HEIRS, EXECUTORS, AS
APPLICABLE, JOINTLY AND SEVERALLY, KNOWINGLY, VOLUNTARILY AND INTENTIONALLY
WAIVES, RELEASES AND FOREVER DISCHARGES AGENT, EACH LENDER, AND THEIR RESPECTIVE
SUBSIDIARIES, AFFILIATES, OFFICERS, DIRECTORS, SHAREHOLDERS, EMPLOYEES, AGENTS,
ATTORNEYS, PREDECESSORS, SUCCESSORS AND ASSIGNS, BOTH PRESENT AND FORMER
(COLLECTIVELY THE "LENDER AFFILIATES") OF AND FROM ANY AND ALL ACTUAL OR
POTENTIAL CLAIMS, DEMANDS, DAMAGES, ACTIONS, REQUESTS FOR SANCTIONS AND CAUSES
OF ACTION, TORTS, OBLIGATIONS, SUITS, DEBTS,

                                       4

<PAGE>

CONTROVERSIES, DAMAGES, JUDGMENTS, EXECUTIONS, CLAIMS AND DEMANDS WHATSOEVER,
ALL OTHER LIABILITIES WHETHER KNOWN OR UNKNOWN, MATURED OR UNMATURED, CONTINGENT
OR ABSOLUTE, OF ANY KIND OR DESCRIPTION WHATSOEVER, EITHER IN LAW OR IN EQUITY,
INCLUDING WITHOUT LIMITATION UNDER THE UNITED STATES BANKRUPTCY CODE OR
OTHERWISE, ASSERTED OR UNASSERTED WHICH AGAINST AGENT, ANY LENDER AND/OR LENDER
AFFILIATES ANY BORROWER EVER HAD, NOW HAVE, CLAIM TO HAVE OR MAY LATER HAVE OR
WHICH ANY OF ANY BORROWER'S SUCCESSORS, ASSIGNS, PARENTS, SUBSIDIARIES,
AFFILIATES, PREDECESSORS, EMPLOYEES, AGENTS, HEIRS, EXECUTORS, AS APPLICABLE,
BOTH PRESENT AND FORMER EVER HAD, NOW HAS, CLAIM TO HAVE OR MAY LATER HAVE, UPON
OR BY REASON OF ANY MANNER, CAUSE, CAUSES OR THING WHATSOEVER, INCLUDING,
WITHOUT LIMITATION, ANY PRESENTLY EXISTING CLAIM OR DEFENSE WHETHER OR NOT
PRESENTLY SUSPECTED, CONTEMPLATED OR ANTICIPATED, AND EACH BORROWER HEREBY
AGREES THAT SUCH BORROWER IS COLLATERALLY ESTOPPED FROM ASSERTING ANY CLAIMS
AGAINST AGENT, LENDER OR ANY OF THE LENDER AFFILIATES RELATING TO THE FOREGOING.

                               [SIGNATURES FOLLOW]

                                       5

<PAGE>

      IN WITNESS WHEREOF, the parties have caused this Amendment No. 3 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 W. TAYLOR
                                          -----------------------------------
                                          Name:  Mr. Michael Taylor
                                          Title:  Chief Financial Officer

                                      PRISON HEALTH SERVICES, INC.


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

                                      EMSA LIMITED PARTNERSHIP,
                                      By its General Partner,
                                      PRISON HEALTH SERVICES, INC.

                                      By: /s/ MICHAEL W. 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 W. TAYLOR
                                          -----------------------------------
                                          Name:  Mr. Michael Taylor
                                          Title:  Senior Vice President

                                      CORRECTIONAL HEALTH SERVICES, LLC
                                      By its Managing Member,
                                      PRISON HEALTH SERVICES, INC.

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


                                       6

<PAGE>

                                      SECURE PHARMACY PLUS, LLC
                                      By its Managing Member,
                                      PRISON HEALTH SERVICES, INC.

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

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

                                      By:
                                          ----------------------------------
                                          Name: Daniel Movihiro
                                          Title: Vice President

AGENT AND LENDER:                     CAPITALSOURCE FINANCE LLC

                                      By:
                                          ----------------------------------
                                          Name: Dean C. Graham
                                          Title: President

                                       7