Updated with afternoon market action, comments from Guggenheim Securities analyst Marty Mosby and Atlantic Equities analyst Richard Staite, The separate settlement with the OCC and the Federal Reserve and more information about Bank of America's sale of mortgage servicing rights. NEW YORK ( TheStreet) -- Bank of America ( BAC) has finally settled with Fannie Mae ( FNMA) in a big money deal that will wipe out nearly all of its fourth-quarter profits. After resisting the government-sponsored mortgage giant's mortgage loan repurchase demands all through 2012 and seeing its mortgage operations partially crippled as a result, Bank of America on Monday announced an agreement covering $1.4 trillion in loans sold to Fannie Mae through 2008. Bank of America will pay Fannie $3.6 billion in cash and pay roughly $6.75 billion to repurchase about 30,000 mortgage loans, which is to be covered by existing mortgage putback reserves, along with "an additional $2.5 billion (pretax) in representations and warranties provision recorded in the fourth quarter of 2012." Bank of America's shares were down a nickel in afternoon trading, to $12.06. The bank agreed to "settle substantially all of Fannie Mae's outstanding and future claims for compensatory fees arising out of past foreclosure delays," which is "expected to be covered by existing reserves and an additional provision of $260 million (pretax) recorded in the fourth quarter of 2012." The settlement will lower Bank of America's fourth-quarter pretax earnings by $2.7 billion, and the company also said that its fourth-quarter results would be "negatively impacted by approximately $2.5 billion (pretax) for the independent foreclosure reviews, litigation (primarily mortgage-related), and other mortgage-related matters." The Independent Foreclosure Review was part of a previous mortgage foreclosure settlement between Bank of America, other large mortgage servicers, including Citigroup ( C), JPMorgan Chase ( JPM), Wells Fargo ( WFC), U.S. Bancorp ( USB) and PNC Financial Services Group ( PNC), with the Federal Reserve and the Office of the Comptroller of the Currency. The regulators on Monday announced that the foreclosure review had ended, and that the servicers subject to the foreclosure settlement would make $8.5 billion in cash payments and other assistance to borrowers victimized by servicing errors. Borrowers could receive up to $125,000 each. Factoring in a $1.3 billion tax benefit from the recognition of foreign tax credits, a benefit from the sale of mortgage servicing rights and "approximately $700 million of pretax negative debit valuation adjustments (DVA) and fair value option (FVO) adjustments related to the continued improvement in the company's credit spreads," the company expects "earnings per share to be modestly positive for the fourth-quarter of 2012." Fannie Mae and its sister company Freddie Mac ( FMCC) were taken under government conservatorship in September 2008. Fannie said in a filing that the $10.3 billion payment by Bank of America and associated agreements address "substantially all of our outstanding repurchase requests made to Bank of America. As of September 30, 2012, $10.8 billion, or 67%, of our $16.2 billion in outstanding repurchase requests to all our mortgage seller/servicers, as measured by unpaid principal balance, had been made to Bank of America. Accordingly, the amount of our outstanding repurchase requests will decrease substantially in the first quarter of 2013 as a result of the resolution agreement."