Bank of America has agreed to buy Countrywide Financial for 4 billion dollars in stock.
The deal rescues the country's largest mortgage lender from bankruptcy and expands the financial services empire of the Charlotte bank.
The deal will make the nation's largest consumer bank the nation's largest mortgage lender and loan servicer.
Bank of American chief executive Ken Lewis says Countrywide is an opportunity for the bank to add what it calls "the best domestic mortgage platform" at an attractive price.
The deal comes just months after Bank of America put 2 billion dollars in Countrywide Financial during the height of the global credit crunch.
Bart Narter with the Boston consulting firm Celent says there is risk in the move, but it could be profitable on a long-term basis.