Warren Buffett's company Berkshire Hathaway has announced it is investing $5bn (£3.1bn) in Bank of America.

News of the famous investor's move sent Bank of America's shares up by 25%, before moving back to 10% ahead.

The loss-making bank, which has been hit hard by the US housing crash and subsequent market crisis, cut 3,500 jobs this month.

Mr Buffett said that he was "impressed" that the bank was "acting aggressively to put their challenges behind them".

"[Mr] Buffet is gaining a reputation as the de-facto investor of last resort/saviour of American corporate might after investing in other banks and General Motors when they were on their knees in recent years," said market watcher Kathleen Brooks from Forex.com.

In July, the bank reported a record quarterly loss after agreeing an $8.5bn settlement relating to sub-prime mortgages.

It is also being sued by insurance group AIG for $10bn. AIG accuses the bank of carrying out a "massive fraud" on bad mortgage debt, something that Bank of America denies.

AIG alleges that Bank of America exaggerated the quality of the $28bn of mortgage-backed investment products it bought from the bank prior to the 2008 turmoil in the financial markets.

Bath idea

Bank of America's share price has halved in value over the past six months. The sharp rise when the market opened took shares up to $8.80. In March they peaked at just under $15.

Mr Buffett - nicknamed the Sage of Omaha - told CNBC he had not spoken to Bank of America's boss Brian Moynihan before Wednesday, and that he conjured up the investment idea while taking a bath.

His company Berkshire Hathaway will receive a dividend of 6% on the investment, regarded as a very good return by analysts.

Bank of America can buy back the stake at any time at a 5% premium on the sale price.

"Bank of America is a strong, well-led company, and I called Brian to tell him I wanted to invest in it," said Mr Buffett in a statement.

"I am impressed with the profit-generating abilities of this franchise."