Exhibit 10.4 MASTER PURCHASE AGREEMENT THIS MASTER PURCHASE AGREEMENT is made as of this 30 day of June, 1997, by and among FRIO PORTFOLIO INVESTORS, L.L.C., a Delaware limited liability company ("Frio"), RIO PORTFOLIO PARTNERS, L.P., a Delaware limited partnership ("RIO"), BLACKROCK CAPITAL FINANCE, L.P., a Delaware limited partnership ("BlackRock"), BRAZOS FUND, L.P., a Delaware limited partnership ("Brazos") and MF SWAPCO, INC., a Delaware corporation ("MF") (collectively, "Sellers"), MUNICIPAL MORTGAGE AND EQUITY, L.L.C., a Delaware limited liability company ("MuniMae" or "Purchaser"), and MME I CORPORATION, a Maryland corporation ("MME I"). WHEREAS, Frio, RIO, BlackRock and MF own all of the membership interests (the "Membership Interests") in BlackCap, LLC, a Delaware limited liability company ("BlackCap"); WHEREAS, BlackRock owns all of the bonds known as $10,300,000 Newport News Redevelopment and Housing Authority 1995 Housing Revenue Refunding Bonds (Indian Lakes Apartments Project) (the "Indian Lakes Bonds"); WHEREAS, pursuant to a certain Servicing Agreement and certain Special Servicing Agreements (collectively, the "Servicing Agreements"), Brazos acts as the Servicer and Special Servicer for the Indian Lakes Bonds and as Special Servicer for certain bonds (the "Additional Bonds") issued with respect to multifamily housing projects located in Independence, Missouri and Locarno, Missouri and Columbia, Maryland (the Indian Lakes Bonds and the Additional Bonds being collectively referred to herein as the "Bonds"); and WHEREAS, Sellers desire to sell and MuniMae and MME I desire to purchase all of the Sellers' right, title and interest in and to the foregoing Membership Interests, Indian Lakes Bonds and the parties desire to provide a mechanism for the transfer of the Servicing Agreements without additional cost. NOW, THEREFORE, in consideration of the foregoing, and for other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties hereby agree as follows: 1. SALE OF BLACKCAP. (a) PURCHASE AND SALE. Frio, RIO, MF and BlackRock, constituting all of the members of BlackCap, hereby agree to assign, sell and convey to MuniMae and MME I all of their right, title and interest in and to all of the Membership Interests in BlackCap. MuniMae and MME I hereby agree to pay the sum of One Million Dollars ($1,000,000) for these interests. The parties agree that MuniMae may deliver the purchase price 1 to BlackRock and shall have no responsibility for the further distribution thereof, it being BlackRock's responsibility to allocate and distribute the money among the Sellers. (b) ASSUMPTION OF BLACKROCK'S RESPONSIBILITIES. MuniMae hereby agrees to assume, effective as of the closing date, all of BlackRock's obligations under the FNMA Documents (as hereinafter defined). MuniMae and BlackRock acknowledge that the approval of Federal National Mortgage Association ("FNMA") is required for such assumption and they agree to cooperate in obtaining such approval and to execute an Assignment, Assumption and Consent substantially in the form of Exhibit A. 2. BLACKCAP SELLERS' REPRESENTATIONS AND WARRANTIES. Frio, RIO, MF and BlackRock hereby jointly and severally represent and warrant the following to MuniMae and MME I, each such representation and warranty to be effective as of the date hereof and as of the date of closing: (a) TITLE. Frio, RIO, MF and BlackRock own 100% of the Membership Interests in BlackCap, LLC free and clear of all liens, claims and encumbrances. Upon the conveyance of the Membership Interests to MuniMae or its designee, MuniMae or its designee will own 100% of the Membership Interests in BlackCap. (b) LIABILITIES. BlackCap has no liabilities whatsoever except for its contractual obligations to FNMA under the documents listed on Exhibit B hereto (the "FNMA Documents"). There are no other agreements by which BlackCap or any of its properties or assets is bound except for the FNMA Documents listed on Exhibit A. True and correct copies of each of the FNMA Documents have been delivered to MuniMae. No Event of Default and no Potential Event of Default (each as defined in the FNMA Documents) exists with respect to the FNMA Documents. (c) ASSETS. BlackCap owns and will as of closing own each of the assets listed on Schedule A free and clear of all liens, claims and encumbrances except for such restrictions as may be imposed thereon by the FNMA Documents. 3. SALE OF INDIAN LAKES BONDS. BlackRock and Brazos collectively own, or have the right to, and hereby agree to, cause the sale of the Indian Lakes Bonds to MuniMae, and MuniMae hereby agrees to buy the $10,145,000 of outstanding Indian Lakes Bonds, for the sum of $10,297,783, plus accrued interest to the date of purchase. If the Bonds are certificated, BlackRock and Brazos agree to deliver the Bonds, with appropriate fully executed instruments of transfer attached, to MuniMae or its designee on the date of purchase. If the Bonds are uncertificated, BlackRock and Brazos hereby agree to provide the Indian Lakes Bonds registrar, any brokerage firm on whose records the Bonds are registered for 2 the benefit of BlackRock or Brazos, and Depository Trust Corporation or its nominee with irrevocable instructions to register the Bonds in the name of MuniMae or its designee. The purchase price shall be paid in immediately available funds on the date of closing. 4. REPRESENTATIONS AND WARRANTIES REGARDING INDIAN LAKES BONDS. BlackRock hereby represents and warrants the following to MuniMae, each such representation and warranty to be effective as of the date hereof and as of the date of closing: (a) TITLE. Merrill Lynch Portfolio Management, Inc. owns 100% of the Indian Lakes Bonds, free and clear of all liens, claims and encumbrances. (b) TAX EXEMPTION. BlackRock is not aware of any claim by the Internal Revenue Service, or of any facts which would support a claim by the Internal Revenue Service, that interest on the Indian Lakes Bonds is not excludable from gross income for purposes of federal income taxation. 5. TRANSFER OF SERVICING AGREEMENTS. Brazos agrees to amend the Servicing and Special Servicing Agreements to permit Brazos to be terminated at any time without cause as Servicer and Special Servicer under the Indian Lakes Bonds and as Special Servicer under the Additional Bonds, subject, however, to FNMA's approval in the case of the Additional Bonds. Brazos agrees to use its best efforts to obtain FNMA's approval to a change of Special Servicer for the Additional Bonds to MuniMae or its designee. The appointment of MuniMae or its designee as Servicer and Special Servicer under each Servicing Agreement shall be independent, such that if FNMA's approval is obtained for some agreements but not others, those agreements for which it is obtained (or is not needed) shall be transferred without regard to the others. 6. CLOSING. Closing of the various purchases and transfers described in this Agreement shall take place at a mutually agreeable time and place, but not later than (a) June 16, 1997 as to the purchase described in Section 1,(b) June 30, 1997, as to the purchase described in Section 3, and (c) as set forth in Section 5 with respect to the transfers described. 7. FURTHER ASSURANCES. Each party agrees to execute such other documents and instruments as may be necessary to consummate each of the transactions described in this Agreement. Each party agrees to cooperate with each other party in obtaining any necessary approvals and each party agrees to procure any necessary approvals diligently and in good faith. 8. EVALUATION OF MATERIALS. Sellers agree to provide Purchaser with 3 any and all materials in Sellers' possession, or reasonably accessible to Sellers, which Purchaser may desire in order to evaluate the various purchases and transfers set forth in this Agreement. Without limiting the generality of the foregoing, Sellers shall give Purchaser complete access to Sellers' books and records regarding BlackCap, the Indian Lakes Bonds, and each of the Additional Bonds. Sellers shall also give Purchaser access to any of Sellers' books and records regarding Sellers' relationship with FNMA as it relates to the purchases and transfers which are the subject of this Agreement. By written notice to Sellers delivered no later than June 13, 1997, Purchaser may, as a result of its evaluation of Seller's materials, terminate this Agreement as to any purchase or transfer not yet closed. 9. COMPLETE AGREEMENT. This Agreement constitutes the complete agreement of the parties hereto and may not be modified except in a writing signed by the party against which such modification is sought to be enforced. Each provision of this Agreement shall be deemed severable, so that if any provision of this Agreement is held unenforceable, the remainder shall be enforced so as to give effect to the intent of the parties. 10. GOVERNING LAW. This Agreement shall be governed by the internal laws of the State of Maryland (excluding reference to principles of conflicts of law). 11. NOTICES. Any notice required or permitted to be given under this Agreement shall be deemed received when delivered if sent by telecopy, by recognized overnight courier, or by hand-delivery, or two days after mailing, if sent by first-class mail, postage prepaid, return receipt requested, to the following addresses, or to such other addresses as the parties by notice delivered hereunder may designate: If to Sellers: BlackRock Capital Finance L.P. 345 Park Avenue 30{th} Floor New York, New York 10154 Attention: Mark Begeny With a copy to: Hudson Advisors LLC 600 N. Pearl Street Suite 1500 Dallas, Texas 75201 Attention: Jeffrey Yarckin 4 If to Purchaser Municipal Mortgage and Equity, or to MME I: L.L.C. 218 North Charles Street Suite 500 Baltimore, Maryland 21201 Attention: Michael L. Falcone With a copy to: Gallagher, Evelius & Jones 218 N. Charles Street Suite 400 Baltimore, Maryland 21201 Attention: Stephen A. Goldberg, Esq. 12. DECISION TO PURCHASE. Purchaser represents and warrants to Seller (a) that Purchaser is a sophisticated investor with knowledge of and experience in the areas of multi-family housing projects and the financing of the same by means of both conventional and tax-exempt financing, (b) that Purchaser has read and understands the FNMA Documents and, in particular, that the Collateral Account (as defined in the FNMA Documents) is available for all loss experienced with respect to the Mortgage Loans delivered pursuant to the FNMA Documents, (c) that Purchaser has had or, at the time it consummates the transactions contemplated hereby, will have had, an opportunity to conduct such due diligence review and analysis of BlackCap, the Membership Interests, the FNMA Documents, the Mortgage Loans and the related information as the Purchaser deems appropriate, necessary or desirable in order to make a complete, informed decision with respect to the transactions contemplated hereby, (d) that the transactions contemplated hereby involve a significant degree of risk and (e) that in entering into this Agreement and consummating the transactions contemplated hereby, the Purchaser has not relied upon any oral or written information or any representations or warranties whatsoever from any Seller, or any of their respective employees, affiliates, agents or representatives, other than the representations and warranties of the Sellers expressly contained herein. 13. NO USE OF BLACKROCK OR SIMILAR NAME. The Purchaser (a) acknowledges that BlackRock will cause the name of BlackCap to be changed to MMACAP, and (b) shall not use the name BlackRock, BlackCap or any similar name as or in the name of any entity in which it has an interest and which is a party to any of the FNMA Documents. 14. CONTINUING ACCURACY OF BLACKROCK REPRESENTATIONS. All of BlackRock's representations and warranties to FNMA made in, or in connection with, the FNMA Documents, were true and correct when made and are now true and correct, except that as to all representations and warranties made by BlackRock to FNMA under Section 4.2(h) of the Master 5 Recourse Agreement described on Exhibit A (I.E., in connection with the delivery of any Mortgage Loan (as defined in the FNMA Documents) to FNMA), BlackRock represents only that such representations and warranties were true when made. BlackRock shall defend, indemnify and hold MuniMae harmless from any and all cost, loss, or expense (including reasonable attorney's fees) claimed against or incurred by MuniMae arising in any way out of the breach of BlackRock's representations and warranties in this Agreement or in the FNMA Documents, including costs incurred in any seeking the advice of counsel with respect to, or in enforcing, the provisions of this paragraph. BlackRock shall have no liability, however, for any of its representations or warranties which become inaccurate after the closing date. 6 IN WITNESS WHEREOF, and intending to be legally bound, the parties have executed this Agreement as of the date and year first above written. WITNESS: SELLERS: FRIO PORTFOLIO INVESTORS, L.L.C. By: Brazos Fund, L.P., Managing Member By: Brazos Principal GenPar, L.P., its General Partner By: Brazos GenPar, Inc., its General Partner By: /S/ LOUIS PALETTA Name: Louis Paletta Title: Vice President RIO PORTFOLIO PARTNERS, L.P. By: Rio Plata, GenPar, Inc., its General Partner By: /S/ STEVEN LEE Name: Steven Lee Title: Vice President BLACKROCK CAPITAL FINANCE, L.P. By: BlackRock Asset Investors, Its General Partner By: /S/ RANDAL A. NARDONE Name: Randal A. Nardone Title: Managing Director 7 BRAZOS FUND, L.P. By: Brazos Principal GenPar, L.P., its General Partner By: Brazos GenPar, Inc., its General Partner By: /S/ LOUIS PALETTA Name: Louis Paletta Title: Vice President MF SWAPCO, INC. By: /S/ RANDAL A. NARDONE Name: Randal A. Nardone Title: Secretary PURCHASER: MUNICIPAL MORTGAGE AND EQUITY, L.L.C. By: /S/ MICHAEL L. FALCONE Name: Michael L. Falcone Title: Executive Vice President MME I CORPORATION By: Name: Title: 8 SCHEDULE A LIST OF BLACKCAP ASSETS AGREEMENT AMOUNT Custodian Agreement dated November 1, 1996 between Fannie Mae, BlackCap LLC, US Trust $1,329,551.24 MBS Lag Agreement between Fannie Mae and Boatmens Trust (Locarno and Independence) $ 29,000.00 [The purchase amount for these accounts is equal to $1,000,000.00] $1,358,551.24 9 ASSIGNMENT, ASSUMPTION AND CONSENT AGREEMENT This Assignment, Assumption and Consent Agreement ("Agreement") is made as of this _____ day of June, 1997, between FEDERAL NATIONAL MORTGAGE ASSOCIATION ("Fannie Mae"), BLACKROCK CAPITAL FINANCE, L.P. ("Assignor") and MUNICIPAL MORTGAGE AND EQUITY, L.L.C. ("Assignee"). RECITALS A. Fannie Mae and Assignor, together with BlackCap LLC, are parties to that certain Master Recourse Agreement (the "Master Recourse Agreement"), dated as of November 1, 1996. B. Assignor desires to assign all of its rights, interests and obligations under the Master Recourse Agreement to Assignee, and Assignee desires to assume all of Assignor's obligations under the Master Recourse Agreement. C. The Master Recourse Agreement affords Fannie Mae the right to consent to the assignment of Assignor's rights, interest and obligations under the Master Agreement, and Fannie Mae has agreed to consent to that assignment. NOW, THEREFORE, Fannie Mae, Assignor and Assignee agree as follows: Section 1. Representations and Warranties. (a) Fannie Mae and Assignor each warrant and represent that (i) attached hereto as Exhibit A is a true, accurate and complete copy of the Master Recourse Agreement and (ii) the Master Recourse Agreement is in full force and effect as of the date hereof and has not been amended or modified in any respect nor has any notice of termination been given thereunder. (b) Assignor represents and warrants that there is no Event of Default or Potential Event of Default (as such terms are defined in the Master Recourse Agreement) in existence on the date hereof. (c) Fannie Mae represents and warrants that it has no knowledge of any Event of Default (as defined above). Section 2. ASSIGNMENT AND ASSUMPTION. Assignor hereby assigns to Assignee all of its rights, interests and obligations under the Master Recourse Agreement, and Assignee hereby assumes all of Assignor's rights, interests and obligations (whether based on past or future events) under the Master Recourse Agreement, including without limitation, Assignor's obligations with respect to the representations and warranties in Section 4.2(i) of the Master Recourse Agreement and the indemnification obligations related thereto in Section 1 7.1(b)(ii) and (iv) of the Master Recourse Agreement; provided, however, nothing herein shall be construed to limit Assignee's rights against Assignor in the event of the breach of any representation or warranty by Assignor. Concurrently with this Agreement, Assignee is acquiring all of the member interests in BlackCap, LLC, the name of which is being changed to MMACap, LLC and Assignee and Assignor agree to take all actions necessary to continue the perfection of the security interest in any Collateral (as defined in the Master Recourse Agreement) . Section 3. CONSENT AND ACKNOWLEDGMENT. Fannie Mae consents to the assignment and assumption set forth in Section 2 and acknowledges that Assignor is relieved of all of its obligations under the Master Recourse Agreement. Section 4. COUNTERPARTS. This Agreement may be executed in counterparts. IN WITNESS WHEREOF, the parties hereto have executed this Agreement the day and year first above written. WITNESS: FEDERAL NATIONAL MORTGAGE ASSOCIATION By: _____________________________ Name: _______________________ Title: ______________________ BLACKROCK CAPITAL FINANCE, L.P. By: ____________________________ Name: ______________________ Title: _____________________ MUNICIPAL MORTGAGE AND EQUITY, L.L.C. By: ______________________________ Name: ________________________ Title: _______________________ 2 EXHIBIT B FNMA DOCUMENTS 1. Master Recourse Agreement by and among FNMA, BlackCap and BlackRock dated as of November 1, 1996. 2. Custodial Agreement by and among FNMA, BlackCap and BlackRock dated as of November 1, 1996. 3. Certificate of Authorized Representatives executed by BlackCap, and dated November 20, 1996. 4. Letter of Acceptable Collateral executed by BlackCap dated November 20, 1996. 5. Assignment executed by BlackCap in favor of FNMA dated November 20, 1996. 6. Mortgage Loan Certificate by and among FNMA, BlackCap and BlackRock dated November 27, 1996. 3