NEW YORK – Warren Buffett comes to the rescue again. Buffett’s Berkshire Hathaway Inc. announced Thursday that it would invest $5 billion in Bank of America Corp., a much-needed vote of confidence that sent the beleaguered bank’s stock soaring 9 percent.

“Buffett is Bank of America’s white knight,” said Glenn Schorr, bank analyst at Nomura equity research.

The legendary investor said in a prepared statement that he reached out personally to Bank of America CEO Brian Moynihan to say he wanted to invest because he considered the bank a “strong, well-led company.”

Lately, the market has rendered a different verdict.

As recently as Tuesday, Bank of America’s stock had plunged 50 percent from a year ago on concerns over its mortgage problems and worries that it would have to sell large amounts of stock to shore up its balance sheet.

The sell-off was seen as a major challenge for the bank and Moynihan, who has been at the helm since January 2010.

While Buffett’s $5 billion investment is a drop in the bucket at the largest U.S. bank with $2.2 trillion in assets, it comes with an imprimatur of confidence that is worth a lot more. In that sense, Buffett’s investment is largely symbolic.

“The investment eliminates the big credibility gap that management had with investors,” said Jonathan Finger, partner of Houston-based Finger Interests Ltd., a long-time shareholder that owns 1.1 million shares.

“It’s time now to demonstrate they have a plan to grow the business,” he said.

Bank of America had cash and cash-equivalent securities of $402 billion at the end of second quarter. Its cash level is at the highest level in the bank’s history.

Much of the Charlotte, N.C. bank’s problems, however, stem from its 2008 purchase of the nation’s largest mortgage lender, Countrywide Financial Corp., but it faces a litany of other challenges.

The bank lost $15.3 billion in the last four quarters. Its revenue fell 34 percent in the first half of 2011 from the same period a year ago, to $40 billion, after new regulations prevented it from collecting fees from checking account overdrafts and credit cards.

Half of all U.S. households have an account or do business with it, making it more exposed than rivals to weakness in the economy.

Investors’ confidence in the bank took another blow this month as its mortgage headaches got worse.

On Aug. 8, American International Group Inc. sued the bank for more than $10 billion, saying it deceived the insurer by selling it faulty mortgage investments. The bank has already paid a total of $12.7 billion this year to settle similar claims.

The AIG lawsuit amplified worries that more investors would sue the bank and drain its coffers.

The slide in the stock intensified, falling as much as 36 percent just this month.

Then Buffett turned his eyes toward Bank of America.

On Wednesday, Buffett got his idea for investing in the bank while sitting in a bathtub, he told CNBC. Buffett’s assistant called Moynihan’s office, asking that the CEO contact Buffett on his personal number.

One of the most successful and respected investors of all time, Buffett has lent his credibility to several other icons of American business at times when investors’ confidence in them was waning.

His moves are followed closely by millions of investors worldwide.

Buffett pumped $5 billion into the blue-chip investment bank Goldman Sachs Group Inc. at the height of the 2008 financial crisis, helping to reverse a crisis of confidence in the bank and the U.S. banking system in general.

In late 2008, before Buffett made his investment in the company, Goldman Sachs’ stock had fallen nearly 50 percent from its peak of $247.92. It jumped 5 percent immediately after the deal was announced.