EXHIBIT 10.4.5


                                 AMENDMENT NO. 5
                           TO THE AMENDED AND RESTATED
                       MASTER LOAN AND SECURITY AGREEMENT

            AMENDMENT NO. 5, dated as of September 15, 2004 (this "Amendment"),
to the Amended and Restated Master Loan and Security Agreement, dated as of
November 26, 2003 (as amended, supplemented or otherwise modified prior to the
date hereof, the "Existing Loan Agreement"; as amended, hereby and as further
amended, restated, supplemented or otherwise modified and in effect from time to
time, the "Loan Agreement"), by and among AMERICAN HOME MORTGAGE CORP. ("AHMC"),
AMERICAN HOME MORTGAGE ACCEPTANCE, INC. ("AHM Acceptance"), AMERICAN HOME
MORTGAGE INVESTMENT CORP. ("AHM Investment"), AMERICAN HOME MORTGAGE HOLDINGS,
INC. ("AHM Holdings") and AMERICAN HOME MORTGAGE SERVICING, INC., formerly known
as Columbia National, Incorporated ("AHM Servicing" and together with AHMC, AHM
Acceptance, AHM Investment and AHM Holdings, collectively, the "Borrowers",
each, a "Borrower"), the lenders from time to time parties thereto (the
"Lenders") and MORGAN STANLEY BANK, as agent for the Lenders (in such capacity,
the "Agent"). Capitalized terms used but not otherwise defined herein shall have
the meanings given to them in the Existing Loan Agreement.

                                    RECITALS

            The Borrowers have requested that the Lenders agree to amend the
Existing Loan Agreement to extend the Termination Date from September 15, 2004
to September 30, 2004. The Lenders are willing to agree to such amendment, but
only on the terms and subject to the conditions set forth in this Amendment.

            NOW, THEREFORE, in consideration of the premises and for other good
and valuable consideration, the receipt and sufficiency of which is hereby
acknowledged, the Borrowers, the Lenders and the Agent hereby agree as follows:

            SECTION 1. Amendment. Section 1.01 of the Existing Loan Agreement is
hereby amended by deleting the definition of "Termination Date" in its entirety
and substituting in lieu thereof the following new definition:

            "Termination Date" shall mean September 30, 2004 or such earlier
date on which this Loan Agreement shall terminate in accordance with the
provisions hereof or by operation of law.

            SECTION 2. Conditions Precedent. This Amendment shall become
effective on the first date (the "Amendment Effective Date") on which all of the
following conditions precedent shall have been satisfied:

            2.1 Delivered Documents. On the Amendment Effective Date, the Agent
shall have received the following documents, each of which shall be satisfactory
to the Agent in form and substance:




            (a) Amendment. This Amendment, executed and delivered by a duly
authorized officer of each of the Borrowers, the Lenders and the Agent; and

            (b) Other Documents. Such other documents as the Agent or counsel to
the Agent may reasonably request.

            2.2 No Default. On the Amendment Effective Date, except as has been
disclosed to the Agent in writing, including via Internet e-mail, on or before
the Amendment Effective Date, (i) each Borrower shall be in compliance with all
the terms and provisions set forth in the Existing Loan Agreement on its part to
be observed or performed, (ii) the representations and warranties made and
restated by each Borrower pursuant to Section 3 of this Amendment shall be true
and complete on and as of such date with the same force and effect as if made on
and as of such date, and (iii) no Default or Event of Default shall have
occurred and be continuing on such date.

            SECTION 3. Representations and Warranties. Each Borrower hereby
represents and warrants to the Agent and the Lenders that, except as has been
disclosed to the Agent in writing, including via Internet e-mail, on or before
the Amendment Effective Date, it is in compliance with all the terms and
provisions set forth in the Loan Documents on its part to be observed or
performed, and that no Default or Event of Default has occurred or is
continuing, and hereby confirms and reaffirms the representations and warranties
contained in Section 6 of the Loan Agreement.

            SECTION 4. Limited Effect. Except as expressly amended and modified
by this Amendment, the Existing Loan Agreement shall continue to be, and shall
remain, in full force and effect in accordance with its terms; provided,
however, that upon the Amendment Effective Date, all references therein and
herein to the "Loan Documents" shall be deemed to include, in any event, this
Amendment. Each reference to the Loan Agreement in any of the Loan Documents
shall be deemed to be a reference to the Loan Agreement as amended hereby.

            SECTION 5. Counterparts. This Amendment may be executed by each of
the parties hereto on any number of separate counterparts, each of which shall
be an original and all of which taken together shall constitute one and the same
instrument. Delivery of an executed signature page of this Amendment in Portable
Document Format (PDF) or by facsimile transmission shall be effective as
delivery of an executed original counterpart of this Amendment.

            SECTION 6. GOVERNING LAW. THIS AMENDMENT SHALL BE GOVERNED BY, AND
CONSTRUED AND INTERPRETED IN ACCORDANCE WITH, THE LAWS OF THE STATE OF NEW YORK.


                               [SIGNATURES FOLLOW]




            IN WITNESS WHEREOF, the parties hereto have caused this Amendment to
be duly executed and delivered as of the day and year first above written.

                                    BORROWERS

                                    AMERICAN HOME MORTGAGE CORP.


                                    By:    /s/ Alan B. Horn
                                       -----------------------------------------
                                       Name:   Alan B. Horn
                                       Title:  Executive Vice President, General
                                               Counsel, and Secretary


                                    AMERICAN HOME MORTGAGE INVESTMENT CORP.


                                    By:    /s/ Alan B. Horn
                                       -----------------------------------------
                                       Name:   Alan B. Horn
                                       Title:  Executive Vice President, General
                                               Counsel, and Secretary


                                    AMERICAN HOME MORTGAGE HOLDINGS, INC.


                                    By:    /s/ Alan B. Horn
                                       -----------------------------------------
                                       Name:   Alan B. Horn
                                       Title:  Executive Vice President, General
                                               Counsel, and Secretary


                                    AMERICAN HOME MORTGAGE ACCEPTANCE, INC.


                                    By:    /s/ Alan B. Horn
                                       -----------------------------------------
                                       Name:   Alan B. Horn
                                       Title:  Executive Vice President, General
                                               Counsel, and Secretary


                                    AMERICAN HOME MORTGAGE SERVICING, INC.
                                      (f/k/a Columbia National, Incorporated)


                                    By:    /s/ Alan B. Horn
                                       -----------------------------------------
                                       Name:   Alan B. Horn
                                       Title:  Executive Vice President, General
                                               Counsel, and Secretary


                                    MORGAN STANLEY BANK,
                                          as Agent and Lender


                                    By:    /s/ Paul Najarian
                                       -----------------------------------------
                                       Name:   Paul Najarian
                                       Title:  Vice President