EXHIBIT 10.1 STRUCTURED ASSET MORTGAGE INVESTMENTS II INC. DEPOSITOR WELLS FARGO BANK, NATIONAL ASSOCIATION, TRUSTEE AND EMC MORTGAGE CORPORATION SERVICER, SPONSOR AND COMPANY POOLING AND SERVICING AGREEMENT DATED AS OF DECEMBER 1, 2006 STRUCTURED ASSET MORTGAGE INVESTMENTS II INC. Bear Stearns Mortgage Funding Trust 2006-AR5 Mortgage Pass-Through Certificates, Series 2006-AR5 ARTICLE I DEFINITIONS................................................................................2ARTICLE II CONVEYANCE OF MORTGAGE LOANS; ORIGINAL ISSUANCE OF CERTIFICATES...........................57 Section 2.01. Conveyance of Mortgage Loans to Trustee..........................................57 Section 2.02. Acceptance of Mortgage Loans by Trustee..........................................59 Section 2.03. Assignment of Interest in the Mortgage Loan Purchase Agreement...................61 Section 2.04. Substitution of Mortgage Loans...................................................63 Section 2.05. Issuance of Certificates.........................................................64 Section 2.06. Representations and Warranties Concerning the Depositor..........................65 Section 2.07. Representations and Warranties of the Company and Sponsor........................66 Section 2.08. Purposes and Powers of the Trust.................................................69ARTICLE III ADMINISTRATION AND SERVICING OF MORTGAGE LOANS............................................69 Section 3.01. Servicer to Act as Servicer......................................................69 Section 3.02. REMIC-Related Covenants..........................................................71 Section 3.03. Monitoring of Subservicers.......................................................71 Section 3.04. Fidelity Bond....................................................................72 Section 3.05. Power to Act; Procedures.........................................................72 Section 3.06. Due-on-Sale Clauses; Assumption Agreements.......................................73 Section 3.07. Release of Mortgage Files........................................................74 Section 3.08. Documents, Records and Funds in Possession of Servicer To Be Held for Trustee....75 Section 3.09. Standard Hazard Insurance and Flood Insurance Policies...........................76 Section 3.10. Presentment of Claims and Collection of Proceeds.................................77 Section 3.11. Maintenance of the Primary Mortgage Insurance Policies...........................77 Section 3.12. Trustee to Retain Possession of Certain Insurance Policies and Documents.........78 Section 3.13. Realization Upon Defaulted Mortgage Loans........................................78 Section 3.14. Compensation for the Servicer....................................................78 Section 3.15. REO Property.....................................................................79 Section 3.16. Annual Statement as to Compliance; Annual Certification..........................81 Section 3.17. Assessments of Compliance and Attestation Reports................................82 Section 3.18. Reports Filed with Securities and Exchange Commission............................83 Section 3.19. UCC..............................................................................90 Section 3.20. Optional Purchase of Defaulted Mortgage Loans....................................90 Section 3.21. Books and Records................................................................91 Section 3.22. Intention of the Parties and Interpretation......................................91ARTICLE IV ACCOUNTS..................................................................................92 Section 4.01. Custodial Account................................................................92 Section 4.02. Permitted Withdrawals and Transfers from the Custodial Account...................93 Section 4.03. Distribution Account.............................................................94 Section 4.04. Permitted Withdrawals and Transfers from the Distribution Account................95 Section 4.05. Adjustable Rate Supplemental Fund................................................96 Section 4.06. Statements to the Trustee........................................................97 Section 4.07. Reserved.........................................................................98 Section 4.08. Reserve Fund.....................................................................98 Section 4.09. Class XP Reserve Account.........................................................99 Section 4.10. Final Maturity Reserve Account..................................................100ARTICLE V CERTIFICATES.............................................................................101 Section 5.01. Certificates....................................................................101 Section 5.02. Registration of Transfer and Exchange of Certificates...........................109 Section 5.03. Mutilated, Destroyed, Lost or Stolen Certificates...............................112 Section 5.04. Persons Deemed Owners...........................................................112 Section 5.05. Transfer Restrictions on Residual Certificates..................................113 Section 5.06. Restrictions on Transferability of Certificates.................................114 Section 5.07. ERISA Restrictions..............................................................114 Section 5.08. Rule 144A Information...........................................................115ARTICLE VI PAYMENTS TO CERTIFICATEHOLDERS...........................................................116 Section 6.01. Distributions on the Certificates...............................................116 Section 6.02. Allocation of Losses and Subsequent Recoveries..................................124 Section 6.03. Payments........................................................................125 Section 6.04. Statements to Certificateholders................................................125 Section 6.05. Monthly Advances................................................................128 Section 6.06. Compensating Interest Payments..................................................129 Section 6.07. Distributions on REMIC Regular Interests........................................129ARTICLE VII THE SERVICER.............................................................................130 Section 7.01. Liabilities of the Servicer.....................................................130 Section 7.02. Merger or Consolidation of the Servicer.........................................130 Section 7.03. Indemnification of the Trustee..................................................130 Section 7.04. Limitations on Liability of the Servicer and Others.............................131 Section 7.05. Servicer Not to Resign..........................................................132 Section 7.06. Successor Servicer..............................................................132 Section 7.07. Sale and Assignment of Servicing................................................132ARTICLE VIII DEFAULT..................................................................................133 Section 8.01. Events of Default...............................................................133 Section 8.02. Trustee to Act; Appointment of Successor........................................135 Section 8.03. Notification to Certificateholders..............................................136 Section 8.04. Waiver of Defaults..............................................................136 Section 8.05. List of Certificateholders......................................................136ARTICLE IX CONCERNING THE TRUSTEE...................................................................137 Section 9.01. Duties of Trustee...............................................................137 Section 9.02. Certain Matters Affecting the Trustee...........................................139 Section 9.03. Trustee Not Liable for Certificates or Mortgage Loans...........................140 Section 9.04. Trustee May Own Certificates....................................................141 Section 9.05. Trustee' s Fees and Expenses.....................................................141 Section 9.06. Eligibility Requirements for Trustee............................................141 Section 9.07. Insurance.......................................................................141 Section 9.08. Resignation and Removal of the Trustee..........................................142 Section 9.09. Successor Trustee...............................................................142 Section 9.10. Merger or Consolidation of Trustee..............................................143 Section 9.11. Appointment of Co-Trustee or Separate Trustee...................................143 Section 9.12. Federal Information Returns and Reports to Certificateholders; REMIC Administration............................................................144ARTICLE X TERMINATION..............................................................................147 Section 10.01. Termination Upon Repurchase by the Depositor or its Designee or Liquidation of the Mortgage Loans...........................................................147 Section 10.02. Additional Termination Requirements.............................................149ARTICLE XI MISCELLANEOUS PROVISIONS.................................................................151 Section 11.01. Intent of Parties...............................................................151 Section 11.02. Amendment.......................................................................151 Section 11.03. Recordation of Agreement........................................................152 Section 11.04. Limitation on Rights of Certificateholders......................................152 Section 11.05. Acts of Certificateholders......................................................153 Section 11.06. Governing Law...................................................................154 Section 11.07. Notices.........................................................................154 Section 11.08. Severability of Provisions......................................................155 Section 11.09. Successors and Assigns..........................................................155 Section 11.10. Article and Section Headings....................................................155 Section 11.11. Counterparts....................................................................155 Section 11.12. Notice to Rating Agencies.......................................................155 Section 11.13. Use of Subservicers and Subcontractors..........................................156 EXHIBITSExhibit A-1 - Form of Class A CertificateExhibit A-2 - ReservedExhibit A-3 - Form of Class B CertificateExhibit A-4 - Form of Class B-IO CertificateExhibit A-5 - Form of Class R CertificateExhibit A-6 - Form of Class R-X CertificateExhibit A-7 - Form of Class X CertificateExhibit A-8 - Form of Class XP CertificateExhibit B - Mortgage Loan ScheduleExhibit C - ReservedExhibit D - Request for Release of DocumentsExhibit E - Form of Affidavit pursuant to Section 860E(e)(4)Exhibit F-1 - Form of Investment Letter (Non-Rule 144A)Exhibit F-2 - Form of Rule 144A Investment RepresentationExhibit F-3 - Form of Transferor Representation LetterExhibit G - Form of Custodial AgreementExhibit H - Form of Mortgage Loan Purchase AgreementExhibit I - Form of Trustee Limited Power of AttorneyExhibit J - ReservedExhibit K - Loan Level Format for Tape Input, Servicer Period ReportingExhibit L - Reporting Data for Defaulted LoansExhibit M - ReservedExhibit N - Form of Cap ContractsExhibit O - ReservedExhibit P Servicing Criteria to be Addressed in Assessment of ComplianceExhibit Q-1 - Form of Servicer Back-Up CertificationExhibit Q-2 - Form of Trustee Back-Up CertificationExhibit R - Form 10-D, Form 8-K and Form 10-K Reporting ResponsibilityExhibit S - Additional Disclosure InformationExhibit T - Reserved SCHEDULESSchedule A - Coupon Strip Reserve Account Schedule POOLING AND SERVICING AGREEMENT Pooling and Servicing Agreement dated as of December 1, 2006, among Structured Asset Mortgage Investments II Inc., aDelaware corporation, as depositor (the " Depositor" ), Wells Fargo Bank, National Association, a banking association organized underthe laws of the United States, not in its individual capacity but solely as trustee (the " Trustee" ) and EMC Mortgage Corporation, asservicer (in such capacity, the " Servicer" ), as company (in such capacity, the " Company" or " EMC" ) and, as sponsor (in such capacity,the " Sponsor" ). PRELIMINARY STATEMENT On or prior to the Closing Date, the Depositor acquired the Mortgage Loans from the Sponsor. On the Closing Date, theDepositor will sell the Mortgage Loans and certain other property to the Trust Fund and receive in consideration thereforCertificates evidencing the entire beneficial ownership interest in the Trust Fund. The Trustee on behalf of the Trust shall make an election for the assets constituting REMIC I to be treated for federalincome tax purposes as a REMIC. On the Startup Day, the REMIC I Regular Interests will be designated " regular interests" in suchREMIC. The Trustee on behalf of the Trust shall make an election for the assets constituting REMIC II to be treated for federalincome tax purposes as a REMIC. On the Startup Day, the REMIC II Regular Interests will be designated " regular interests" in suchREMIC. The Trustee on behalf of the Trust shall make an election for the assets constituting REMIC III to be treated for federalincome tax purposes as a REMIC. On the Startup Day, the REMIC III Regular Interests will be designated " regular interests" in suchREMIC. The Trustee on behalf of the Trust shall make an election for the assets constituting REMIC IV to be treated for federalincome tax purposes as a REMIC. On the Startup Day, the REMIC IV Regular Interests will be designated the " regular interests" insuch REMIC. The Class R Certificates will evidence ownership of the " residual interest" in each of REMIC I, REMIC II and REMIC III. TheClass R-X Certificates will evidence ownership of the " residual interest" in REMIC IV. The Group I Mortgage Loans will have an Outstanding Principal Balance as of the Cut-off Date, after deducting all ScheduledPrincipal due on or before the Cut-off Date, of $849,583,064.66. The Group II Mortgage Loans will have an Outstanding PrincipalBalance as of the Cut-off Date, after deducting all Scheduled Principal due on or before the Cut-off Date, of $1,023,269,558.44. In consideration of the mutual agreements herein contained, the Depositor, the Servicer, the Sponsor, the Company and theTrustee agree as follows: ARTICLE I Definitions Whenever used in this Agreement, the following words and phrases, unless otherwise expressly provided or unless the contextotherwise requires, shall have the meanings specified in this Article. 2006-AR5 REMIC: Any of REMIC I, REMIC II, REMIC III and REMIC IV. Accepted Servicing Practices: The procedures, including prudent collection and loan administration procedures, and thestandard of care (i) employed by prudent mortgage servicers which service mortgage loans of the same type as the Mortgage Loans inthe jurisdictions in which the related Mortgage Properties are located or (ii) in accordance with the Fannie Mae Guide or Freddie MacGuide, subject to any variances negotiated with Fannie Mae or Freddie Mac and subject to the express provisions of this Agreement.Such standard of care shall not be lower than that the Servicer customarily employs and exercises in servicing and administeringsimilar mortgage loans for its own account and shall be in full compliance with all federal, state, and local laws, ordinances, rulesand regulations. Account: The Custodial Account, the Adjustable Rate Supplemental Fund, the Distribution Account, the Reserve Fund, theFinal Maturity Reserve Account or the Class XP Reserve Account, as the context may require. Actual Monthly Payments: For any Mortgage Loan and each Due Period, the actual monthly payments of principal and interestreceived during such month on such Mortgage Loan. Additional Disclosure: As defined in Section 3.18(a)(v). Additional Form 10-D Disclosure: As defined in Section 3.18(a)(i). Additional Form 10-K Disclosure: As defined in Section 3.18(a)(iv). Adjustable Rate Supplemental Fund: An " outside reserve fund" within the meaning of Treasury Regulation 1.860G-2(h), which isnot an asset of any REMIC and which is established and maintained pursuant to Section 4.05. Adjusted Rate Cap: With respect to the Class I-A Certificates and Class I-B Certificates, each Distribution Date and therelated Due Period, the sum of (i) the Scheduled Payments owed on the Group I Mortgage Loans for such Due Period less the relatedServicing Fees and (ii) the related Actual Monthly Payments received in excess of the Scheduled Payments, expressed as a per annumrate calculated on the basis of the aggregate Stated Principal Balance of the Group I Mortgage Loans for such Due Period and furtherreflecting the accrual of interest on an actual/360 basis, minus the sum of (a) the interest payable to the Class I-X Certificatesand (b) the Coupon Strip with respect to Loan Group I, if any, payable to the Final Maturity Reserve Account with respect to suchDistribution Date, expressed as a per annum rate. With respect to the Group II Certificates, each Distribution Date and the related Due Period, the sum of (i) theScheduled Payments owed on the Group II Mortgage Loans for such Due Period less the related Servicing Fees and (ii) the relatedActual Monthly Payments received in excess of the Scheduled Payments, expressed as a per annum rate calculated on the basis of theaggregate Stated Principal Balance of the Group II Mortgage Loans for such Due Period and further reflecting the accrual of intereston an actual/360 basis. Affiliate: As to any Person, any other Person controlling, controlled by or under common control with such Person." Control" means the power to direct the management and policies of a Person, directly or indirectly, whether through ownership ofvoting securities, by contract or otherwise. " Controlled" and " Controlling" have meanings correlative to the foregoing. The Trusteemay conclusively presume that a Person is not an Affiliate of another Person unless a Responsible Officer of the Trustee has actualknowledge to the contrary. Agreement: This Pooling and Servicing Agreement and all amendments hereof and supplements hereto. Annual Certification: As defined in Section 3.16(b) herein. Applicable Credit Rating: For any long-term deposit or security, a credit rating of "AAA" in the case of S&P or "Aaa" in thecase of Moody' s (or with respect to investments in money market funds, a credit rating of " AAAm" or " AAAm-G" in the case of S&P andthe highest rating given by Moody' s for money market funds in the case of Moody' s). For any short-term deposit or security, or arating of "A-l+" in the case of S&P or "Prime-1" in the case of Moody' s. Applicable State Law: For purposes of Section 9.12(d), the Applicable State Law shall be (a) the law of the State of NewYork and (b) such other state law whose applicability shall have been brought to the attention of the Trustee by either (i) anOpinion of Counsel reasonably acceptable to the Trustee delivered to it by the Servicer or the Depositor, or (ii) written notice fromthe appropriate taxing authority as to the applicability of such state law. Applied Realized Loss Amount: With respect to any Distribution Date and a Class of Class A Certificates or Class BCertificates, the sum of the Realized Losses with respect to the Mortgage Loans in the related Loan Group, which are to be applied inreduction of the Current Principal Amount of such Class of Certificates pursuant to this Agreement in an amount equal to the amount,if any, by which, (i) the aggregate Current Principal Amount of all of the Certificates in the related Loan Group (after alldistributions of principal on such Distribution Date) exceeds (ii) the aggregate Stated Principal Balance of all of the MortgageLoans in the related Loan Group for such Distribution Date. The Applied Realized Loss Amount with respect to the Group I MortgageLoans shall be allocated first to the Class I-B-9, Class I-B-8, Class I-B-7, Class I-B-6, Class I-B-5, Class I-B-4, Class I-B-3,Class I-B-2 and Class I-B-1 Certificates, sequentially in that order, in each case until the Current Principal Amount of each suchClass has been reduced to zero. Thereafter, the principal portion of Realized Losses on the Group I Mortgage Loans will be allocatedon any Distribution Date first, to the Class I-A-3 Certificates, then to the Class I-A-2 Certificates, and then to the Class I-A-1Certificates, sequentially in that order, until the Current Principal Amount of each such Class has been reduced to zero. TheApplied Realized Loss Amount with respect to the Group II Mortgage Loans shall be allocated first to the Class II-B-5, Class II-B-4,Class II-B-3, Class II-B-2 and Class II-B-1 Certificates, sequentially in that order, in each case until the Current Principal Amountof each such Class has been reduced to zero. Thereafter, the principal portion of Realized Losses on the Group II Mortgage Loanswill be allocated on any Distribution Date first, to the Class II-A-3 Certificates, then to the Class II-A-2 Certificates, and thento the Class II-A-1 Certificates, sequentially in that order, until the Current Principal Amount of each such Class has been reducedto zero. Appraised Value: For any Mortgaged Property related to a Mortgage Loan, the amount set forth as the appraised value of suchMortgaged Property in an appraisal made for the mortgage originator in connection with its origination of the related Mortgage Loan. Assessment of Compliance: As defined in Section 3.17. Attestation Report: As defined in Section 3.17. Attesting Party: As defined in Section 3.17. Available Funds: With respect to each Distribution Date, the aggregate Principal Funds and Interest Funds for suchDistribution Date. Back-Up Certification: As defined in Section 3.18(a)(iv). Bankruptcy Code: The United States Bankruptcy Code, as amended as codified in 11 U.S.C. a7a7 101-1330. Bankruptcy Loss: Any loss resulting from a bankruptcy court, in connection with a personal bankruptcy of a mortgagor, (1)establishing the value of a mortgaged property at an amount less than the Outstanding Principal Balance of the Mortgage Loan securedby such mortgaged property or (2) reducing the amount of the Monthly Payment on the related Mortgage Loan. Basis Risk Shortfall: On any Distribution Date, the excess, if any, of: 1. the amount of Current Interest that such Class would have been entitled to receive on such Distribution Date had the applicable Pass-Through Rate been calculated at a per annum rate equal to One-Month LIBOR plus the related Margin and (ii) 10.50% per annum, over 2. the amount of Current Interest on such Class calculated using a Pass-Through Rate equal to the related Net Rate Cap for such Distribution Date. Basis Risk Shortfall Carry Forward Amount: With respect to any Distribution Date and each Class of Class A Certificates andClass B Certificates, the sum of the Basis Risk Shortfall for such Distribution Date and the Basis Risk Shortfalls for all previousDistribution Dates not previously paid from any source including the Excess Cashflow and payments under the Cap Contracts, togetherwith interest thereon at a rate equal to the related Pass-Through Rate for such Class of Certificates for such Distribution Date. Book-Entry Certificates: Initially, all Classes of Certificates other than the Private Certificates and the ResidualCertificates. Business Day: Any day other than (i) a Saturday or a Sunday, or (ii) a day on which the New York Stock Exchange or FederalReserve is closed or on which banking institutions in any jurisdiction in which the Trustee, the Custodian or the Servicer areauthorized or obligated by law or executive order to be closed. Cap Contracts: With respect to each Class of the Class II-A Certificates and Class II-B Certificates, the respective capcontracts, dated as of December 29, 2006, between the Trustee, on behalf of the Trust for the benefit of the Holders of the relatedCertificates, and the Cap Counterparty, together with any scheduling, confirmations or other agreements related thereto, a form ofwhich is attached hereto as Exhibit N. Cap Contract Payment Amount: With respect to any Distribution Date and a Cap Contract, the amounts received from such CapContract, if any, on such Distribution Date. Cap Counterparty: ABN AMRO Bank N.V. Certificate: Any mortgage pass-through certificate evidencing a beneficial ownership interest in the Trust Fund signed andcountersigned by the Trustee in substantially the forms annexed hereto as Exhibits A-1, A-3, A-4, A-5, A-6, A-7 and A-8 with theblanks therein appropriately completed. Certificate Group: With respect to Loan Group I, the Group I Certificates, and with respect to Loan Group II, the Group IICertificates. Certificate Owner: Any Person who is the beneficial owner of a Certificate registered in the name of the Depository or itsnominee. Certificate Register: The register maintained pursuant to Section 5.02. Certificateholder: A Holder of a Certificate. Certification Parties: As defined in Section 3.18(a)(iv).