US banking giant, Bank of America, is free to take over the country's biggest mortgage lender, Countrywide Financial after gaining the Federal Reserve's approval.

The regulator cleared the way for the stock swap, originally valued at about $4 billion, the company said in a statement today.

The Fed had been encouraged to reject the deal, in light of lawsuits and investigation's surrounding Countrywide.

By taking over Countrywide, Bank of America will control about a quarter of the U.S. mortgage market. Bank of America is already the largest bank in the country and will have $1.9 trillion in total assets after the merger is completed.

In August 2007, Bank of America had invested $ billion in Countrywide, which had a big presence in the subprime mortgage lending market, but collapsed last summer.

After the Fed announced the decision, Bank of America boss Ken Lewis said: This transaction represents a rare opportunity for Bank of America to significantly gain market share in the mortgage business, allowing it to expand in a cornerstone financial product.