<PAGE>
                                                                    EXHIBIT 10.5

                          GUARANTY AGREEMENT (LIMITED)
                         (United Development Funding IV)

      WHEREAS, COMMUNITY TRUST BANK OF TEXAS ("Lender") has agreed to make a
loan (the "Loan") in the original principal amount of $6,300,000.00 to UMTH LAND
DEVELOPMENT, L.P., a Delaware limited partnership ("Borrower"); and

      WHEREAS, Lender has conditioned its obligation to make the Loan in part
upon obtaining from UNITED DEVELOPMENT FUNDING IV, a real estate investment
trust organized under the laws of the State of Maryland ("Guarantor") this
Guaranty Agreement ("Agreement");

      NOW, THEREFORE, for valuable consideration, the receipt and adequacy of
which are hereby acknowledged, the undersigned, GUARANTOR HEREBY IRREVOCABLY AND
UNCONDITIONALLY GUARANTEES TO LENDER THE PROMPT PAYMENT AND PERFORMANCE OF THE
GUARANTEED INDEBTEDNESS (hereinafter defined), this Agreement being upon the
following terms:

      1. The term "Guaranteed Indebtedness", as used herein means all
obligations, indebtedness and liabilities of Borrower now or hereafter owed to
Lender UNDER THAT CERTAIN PROMISSORY NOTE DATED OF EVEN DATE HEREWITH IN THE
PRINCIPAL AMOUNT OF $6,300,000.00, SIGNED BY BORROWER AND PAYABLE TO THE ORDER
OF LENDER and all interest accruing thereon, together with any and all renewals
and extensions of such obligations, indebtedness and liabilities and all
attorney's fees and other expenses incurred in the enforcement or collection
thereof.

      2. This instrument shall be an absolute, continuing, irrevocable and
unconditional guaranty of payment and performance and not a guaranty of
collection, and Guarantor shall remain liable on the obligations hereunder until
the payment and performance in full of the Guaranteed Indebtedness.

      3. If Guarantor becomes liable for any indebtedness owing by Borrower to
Lender by endorsement or otherwise, other than under this Agreement, such
liability shall not be in any manner impaired or affected hereby, and the rights
of Lender hereunder shall be cumulative of any and all other rights that Lender
may ever have against Guarantor. The exercise by Lender of any right or remedy
hereunder or under any other instrument, or at law or in equity, shall not
preclude the concurrent or subsequent exercise of any other right or remedy.

      4. In the event of default by Borrower in payment or performance of the
Guaranteed Indebtedness, or any part thereof, when such Guaranteed Indebtedness
becomes due, whether by its terms, by acceleration, or otherwise, Guarantor
shall promptly pay the amount due thereon to Lender without notice or demand in
lawful money of the United States and it shall not be necessary for Lender, in
order to enforce such payment by Guarantor, first to institute suit or exhaust
its remedies against Borrower or others liable on such Guaranteed Indebtedness,
or to enforce any rights against any collateral which shall ever have been given
to secure such Guaranteed Indebtedness.

      5. Guarantor hereby agrees that his obligations under this Agreement shall
not be released, diminished, impaired, reduced or affected by the occurrence of
any reason or event, including, without limitation, one or more of the following
events, whether or not with notice to or the consent of Guarantor:

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 1

<PAGE>

            a. The taking or accepting of collateral as security for any or all
      of the Guaranteed Indebtedness or the release, surrender, exchange or
      subordination of any collateral now or hereafter securing any or all of
      the Guaranteed Indebtedness;

            b. Any release of liability of the Borrower, or the release of any
      other person obligated to pay the Guaranteed Indebtedness from liability
      for any or all of the Guaranteed Indebtedness;

            c. Any disability of Borrower or Guarantor, or the dissolution,
      insolvency or bankruptcy of Borrower or any party at any time liable for
      the payment of any or all of the Guaranteed Indebtedness;

            d. Any renewal, extension, modification, waiver, amendment or
      rearrangement of any or all of the Guaranteed Indebtedness or any
      instrument, document or agreement evidencing, securing or otherwise
      relating to any or all of the Guaranteed Indebtedness;

            e. Any adjustment, indulgence, forbearance, waiver or compromise
      that may be granted or given by Lender to Borrower or any other party ever
      liable for any or all of the Guaranteed Indebtedness;

            f. Any neglect, delay, omission, failure or refusal of Lender to
      take or prosecute any action for the collection of any of the Guaranteed
      Indebtedness or to foreclose or take or prosecute any action in connection
      with any instrument, document or agreement evidencing, securing or
      otherwise relating to any or all of the Guaranteed Indebtedness;

            g. The unenforceability or invalidity of any or all of the
      Guaranteed Indebtedness or any other instrument, document or agreement
      evidencing, securing or otherwise relating to any or all of the Guaranteed
      Indebtedness;

            h. Any payment by Borrower or any party at any time liable for the
      payment of any or all of the Guaranteed Indebtedness to Lender is held to
      constitute a preference under the bankruptcy laws or if for any other
      reason Lender is required to refund such payment or pay the amount thereof
      to someone else;

            i. The settlement or compromise of any of the Guaranteed
      Indebtedness;

            j. The failure of Lender to perfect or continue any security
      interest or lien securing any or all of the Guaranteed Indebtedness;

            k. The failure of Lender to preserve, protect, maintain or insure
      any collateral securing any or all of the Guaranteed Indebtedness;

            l. The failure of Lender to sell any collateral securing any or all
      of the Guaranteed Indebtedness in a commercially reasonable manner or as
      otherwise required by law; or

            m. Any other circumstance which might otherwise constitute a defense
      available to, or discharge of, Borrower or Guarantor.

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 2

<PAGE>

      6. Guarantor represents and warrants to Lender as follows:

            a. Guarantor has the power and authority to execute, deliver and
      perform his obligations under this Agreement and this Agreement
      constitutes the legal, valid and binding obligation of Guarantor,
      enforceable against Guarantor in accordance with its terms, except as
      limited by bankruptcy, insolvency or other laws of general application
      relating to the enforcement of creditor's rights.

            b. The execution, delivery and performance by Guarantor of this
      Agreement does not and will not violate any law or any order of any court,
      governmental authority or arbitrator and does not and will not conflict
      with, result in a breach of or constitute a default under, or result in
      the imposition of any lien upon any assets of Guarantor pursuant to the
      provisions of any indenture, mortgage, deed of trust, security agreement,
      franchise, permit, license or other instrument or agreement to which
      Guarantor or his property is bound.

            c. No authorization, approval or consent of, and no filing or
      registration with, any court, governmental authority or third party is
      necessary for the execution, delivery or performance by Guarantor of this
      Agreement or the validity or enforceability thereof.

            d. The value of the consideration received and to be received by
      Guarantor as a result of executing and delivering this Agreement is
      reasonably worth at least as much as the liability and obligation of
      Guarantor hereunder, and such liability and obligation has benefited or
      may reasonably be expected to benefit Guarantor directly or indirectly.

      7. Guarantor covenants and agrees that, as long as the Guaranteed
Indebtedness or any part thereof is outstanding:

            a. Guarantor shall furnish to Lender, as soon as available, and in
      any event within one hundred twenty (120) days after the end of each
      fiscal year of Guarantor beginning with the fiscal year most recently
      ended, (i) a copy of the financial statement of Guarantor for such fiscal
      year and (ii) a certificate of Guarantor to Lender (A) stating that no
      default under the Guaranteed Indebtedness has occurred and is continuing,
      or a statement as to the nature thereof and (B) disclosing and certifying
      as to all material changes in Guarantor's debt or net worth or otherwise
      certifying that there has been no material change in Guarantor's personal
      debt or net worth since the previous financial statement was delivered to
      Lender.

            b. Guarantor shall furnish to Lender, as soon as available, and in
      any event within thirty (30) days of filing same with the Internal Revenue
      Service, a true and correct copy of the annual federal income tax return
      of Guarantor for the immediately preceding year, signed by Guarantor.

            c. Guarantor shall furnish to Lender, as soon as available, and in
      any event within ten (10) days after the end of each calendar month,
      beginning with the calendar month most recently ended, written notice of
      all payments made on the UMTHLD Receivable (as defined herein) during the
      calendar month then ended.

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 3

<PAGE>

            d. Guarantor will furnish promptly to Lender written notice of the
      occurrence of any default of which Guarantor has actual knowledge under
      this Agreement or under the Guaranteed Indebtedness.

            e. Guarantor will furnish promptly to Lender such additional
      information concerning Guarantor as Lender may reasonably request.

            f. Guarantor will obtain at any time and from time to time, if
      applicable, all authorizations, licenses, consents or approvals as shall
      now or hereafter be necessary or desirable under all applicable laws or
      regulations or otherwise in connection with the execution, delivery and
      performance of this Agreement and will promptly furnish copies thereof to
      Lender.

      8. Lender shall have the right to set off and apply against this Agreement
or the Guaranteed Indebtedness or both, without notice to Guarantor, any and all
deposits (general or special, time or demand, provisional or final) or other
sums at any time credited by or owing from Lender to Guarantor, whether or not
the Guaranteed Indebtedness is then due and irrespective of whether or not
Lender shall have made any demand under this Agreement. As security for this
Agreement and the Guaranteed Indebtedness, Guarantor hereby grants Lender a
security interest in all money, instruments and other property of Guarantor now
or hereafter held by Lender, including, without limitation, property held in
safekeeping. In addition to Lender's right of setoff and as further security for
this Agreement and the Guaranteed Indebtedness, Guarantor hereby grants Lender a
security interest in all deposits (general or special, time or demand,
provisional or final) and all other accounts of Guarantor now or hereafter on
deposit with or held by Lender and all other sums at any time credited by or
owing from Lender to Guarantor. The rights and remedies of Lender hereunder are
in addition to other rights and remedies (including, without limitation, other
rights of setoff) which Lender may have.

      9. Guarantor waives any rights Guarantor has under, or any requirement
imposed by, (i) Chapter 34 of the Texas Business and Commerce Code, as amended
(except rights under 34.04), (ii) Section 17.001 of the Texas Civil Practice and
Remedies Code, as amended, (iii) Rule 31 of the Texas Rules of Civil Procedure,
as amended. Furthermore, in the event any property securing the Guaranteed
Indebtedness is foreclosed upon in any manner, and a deficiency is created as a
result of the purchase price at such foreclosure sale, Guarantor does hereby
irrevocably waive all rights to claim any offset against the deficiency as
provided in Section 51.003, 51.004 and 51.005 of the Texas Property Code, as
amended.

      10. All present and future indebtedness of Borrower to Guarantor is hereby
subordinated to the Guaranteed Indebtedness and is hereby assigned to Lender as
security for the Guaranteed Indebtedness. If any sums shall be paid to Guarantor
on account of such indebtedness, such sums shall be held in trust by Guarantor
for the benefit of Lender and shall forthwith be paid to Lender without
affecting the liability of Guarantor under this Agreement. Upon the request of
Lender, Guarantor shall execute, deliver and endorse to Lender such documents
and instruments as Lender deems necessary or appropriate to perfect, preserve
and enforce its rights hereunder.

      11. The guaranty of Guarantor hereunder and those of any other guarantor
or guarantors who may have guaranteed or who may hereafter guarantee any
indebtedness of Borrower are and will be joint and several, and Lender may
release any one or more of the guarantors at any time or settle with any one or
more at any time without affecting the continuing liability of the remaining
guarantors. Guarantor acknowledges that this Agreement is in effect and binding
on Guarantor without regard to whether it is signed by any other person or
persons and agree that as to Guarantor it shall continue in full force and

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 4

<PAGE>

effect notwithstanding the death or release by agreement or by operation of law
of or the extension of time to, any other guarantors.

      12. No amendment or waiver of any provision of this Agreement nor consent
to any departure by the Guarantor therefrom shall in any event be effective
unless the same shall be in writing and signed by Lender. No failure on the part
of Lender to exercise, and no delay in exercising, any right hereunder shall
operate as a waiver thereof; nor shall any single or partial exercise of any
right hereunder preclude any other or further exercise thereof or the exercise
of any other right. The remedies herein provided are cumulative and not
exclusive of any remedies provided by law.

      13. This Agreement is for the benefit of Lender and its successors and
assigns, and in the event of an assignment of the Guaranteed Indebtedness, or
any part thereof, the rights and benefits hereunder, to the extent applicable to
the indebtedness so assigned, may be transferred with such indebtedness. This
Agreement is binding not only on Guarantor but on Guarantor's heirs and personal
representatives.

      14. Guarantor recognizes that Lender is relying upon this Agreement and
the undertakings of Guarantor hereunder in making the Loan to Borrower and
further recognize that the execution and delivery of this Agreement is a
material inducement to Lender in entering into this Agreement. Guarantor has
unconditionally delivered this Agreement to Lender and the failure to sign any
other guaranty by any other person shall not discharge the liability of
Guarantor hereunder.

      15. This Agreement is executed and delivered as an incident to a lending
transaction negotiated, consummated and performable in DALLAS, DALLAS COUNTY,
TEXAS, and shall be governed by and construed in accordance with the laws of the
State of Texas.

      16. Guarantor shall pay on demand all reasonable attorney's fees and all
other costs and expenses incurred by Lender in connection with the preparation,
administration, enforcement or collection of this Agreement.

      17. Guarantor hereby waives promptness, diligence, demand of payment,
notice of acceptance of this Agreement, notice of intent to demand, notice of
intent to accelerate, notice of acceleration, presentment, notice of protest,
notice of dishonor, notice of the incurring by Borrower of additional
indebtedness, and all other notices and demands with respect to the Guaranteed
Indebtedness and this Agreement.

      18. WAIVER OF JURY TRIAL. IN THE EVENT LITIGATION SHOULD ARISE OUT OF THIS
AGREEMENT OR ANY OTHER MATTER RELATED HERETO WHATSOEVER OR IN CONNECTION WITH
ANY COURSE OF CONDUCT, COURSE OF DEALING, STATEMENTS (WHETHER ORAL OR WRITTEN)
OR ACTIONS OR INACTIONS BY LENDER, IT IS HEREBY STIPULATED AND AGREED BY
GUARANTOR THAT HE SHALL WAIVE AND DOES HEREBY KNOWINGLY, VOLUNTARILY AND
INTENTIONALLY WAIVE ALL RIGHTS TO DEMAND A TRIAL OF ANY SUCH MATTER BY OR BEFORE
A JURY.

      19. This Agreement is intended by Guarantor as a final and complete
expression of the terms of the Agreement, no course of dealings between
Guarantor and Lender, no uses of trade and no parole or extrinsic evidence of
any nature shall be used to supplement or modify any term hereof. No condition
to the full effectiveness of this Agreement exists.

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 5

<PAGE>

      20. Guaranty Limits. Notwithstanding anything contained in this Agreement
to the contrary, the liability of Guarantor under this Agreement shall be
limited to $3,116,569.00 in principal of the Guaranteed Indebtedness, plus all
accrued but unpaid interest on such amount, together with any attorney's fees
and costs incurred by Lender in connection with the enforcement of this
Agreement and/or the collection of any sums due hereunder from Guarantor to
Lender.

      21. Reduction of Guaranty Limits. Borrower and Guarantor have warranted
and represented to Lender that Guarantor owes money to Borrower in the form of
an account receivable in an amount equal to the lesser of (i) the actual
expenses incurred in connection with the organizational and offering expenses
incurred on behalf of Guarantor, or (ii) three (3%) of the total investment
capital and other funds now or hereafter raised by Guarantor (the "UMTHLD
Receivable") for legitimate services rendered, organizational and operational
expenses and other monies advanced to or for the benefit of Guarantor by
Borrower or its affiliate to Guarantor. All of Borrower's accounts receivable,
among other things, including without limitation, the UMTHLD Receivable, have
been pledged to Lender as security for the Loan. Guarantor's limitation of
liability as set forth in Section 20 above may be further reduced in accordance
with the following formula. Accordingly, for each dollar that Guarantor pays to
Borrower on and for the account of the UMTHLD Receivable, which can be verified
in writing by Borrower and Guarantor to Lender through cancelled checks or other
form of evidence of payment and corresponding credit by Borrower satisfactory to
Lender and for which written notice of such payment has been delivered to Lender
with each corresponding payment, Guarantor can reduce its liability under this
Guaranty Agreement by an amount equal to each dollar so paid to Borrower on
account of the UMTHLD Receivable. However, this right and ability to reduce
Guarantor's liability contained in the foregoing sentence shall not apply and
shall no longer be available at the point in time that an "Event of Default" (as
that term is defined in the Loan Agreement) occurs. In other words, if such an
"Event of Default" occurs, Guarantor shall no longer be permitted to reduce it
liability under this Guaranty Agreement by any additional amounts. Guarantor
agrees that the obligation to pay the UMTHLD Receivable and its obligations
under this Guaranty Agreement are separate and independent obligations to pay
and perform by Guarantor. Accordingly, the payment of one such obligation by
Guarantor does not reduce the obligations of Guarantor under the other, except
in the limited circumstance as specifically described above. Additionally, and
notwithstanding the foregoing to the contrary, Guarantor must notify Lender in
writing within ten (10) days of the end of each calendar month, of all payments
made on the UMTHLD Receivable during such calendar month. Guarantor shall not be
entitled to reduce its liability under this Guaranty, until Lender has been
notified in writing of such payment made on the UMTHLD Receivable.

      Executed as of June 26, 2009.

                                     GUARANTOR:
                                     United Development Funding IV, a real
                                     estate investment trust organized under
                                     the laws of the State of Maryland.

                                     By: /s/ Hollis M. Greenlaw
                                     -----------------------------------
                                     Hollis M. Greenlaw, Chief Executive Officer

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 6

<PAGE>

THE STATE OF TEXAS

COUNTY OF TARRANT

      Before me Hillary A. Lueck (Notary printed name) on this day personally
appeared Hollis M. Greenlaw, Chief Executive Officer of United Development
Funding IV, a real estate investment trust organized under the laws of the State
of Maryland, known to me or proved to me to be the person whose name is
subscribed to the foregoing instrument and acknowledged to me that he executed
the same for the purposes and consideration therein expressed.

      Given under my hand and seal of office this 1st day of July, 2009.

                                        /s/ Hillary A. Lueck
                                        -----------------------------------
                                        Notary Public, State of Texas

GUARANTY AGREEMENT (LIMITED) (United Development Funding IV) - PAGE 7