Bank of America Corp, the largest U.S. bank by assets, reported a second straight quarterly loss, driven by writedowns in the value of its mortgage business.

The loss highlights the mixed results of the two largest bets the bank's former chief executive, Kenneth Lewis, made at the height of the financial crisis in 2008 -- the purchase of Countrywide Financial Inc and Merrill Lynch & Co.

The purchase of the subprime mortgage giant Countrywide continues to saddle Bank of America with mortgage woes.

In the fourth quarter, the bank recognized a $2 billion writedown in value of its mortgage business, and a $4.1 billion provision for future mortgage repurchase claims.

But Bank of America's global banking and markets unit, which includes Merrill Lynch's former investment bank operations, reported the largest profit of any business unit in the quarter -- $6.3 billion.

Last year was a necessary repair and rebuilding year, said Chief Executive Brian Moynihan in a prepared statement. Our results reflect the progress we are making at putting legacy -- primarily mortgage-related -- issues behind us.

The bank posted a fourth quarter shareholder loss of $1.57 billion, or 16 cents a share, compared with a loss of $5.2 billion, or 60 cents a share, a year earlier. Last year's results included a one-time Troubled Asset Relief Program-related charge of $4 billion.

Excluding the mortgage business writedown, the bank earned $756 million, or 4 cents per share.

Analysts projected earnings of 14 cents per share, according to Thomson Reuters I/B/E/S.

Total revenues decreased 11 percent to $22.7 billion.

The bank's fourth-quarter results were the second straight to include large charges.

In third quarter, the bank reported a $10 billion writedown of its cards business after the U.S. Congress approved a financial reform bill that includes curbs on debit card fees banks can charge merchants.

Bank of America shares were down 1 percent in premarket trading.

(Reporting by Joe Rauch; editing by John Wallace)