The results for the second largest U.S. bank were strong across most businesses, with consumer banking having its best quarter since 2011 and the wealth management and global banking divisions posting record revenues.

"They're showing some positive momentum on growing their customer base and their revenues," said Jonathan Finger of Finger Interests Ltd, a Houston investment firm that owns shares in the bank. "Certainly the stock has been performing very well."

Bank of America's shares rose 2.3 percent to $17.15 on Wednesday, after earlier rising to $17.42, the highest level since May 2010. The bank's shares rose 34.6 percent last year, outpacing the broader market, and have risen some 250 percent from their post-crisis nadir in December 2011.

Bank of America has been groaning under the weight of bad mortgages it took on when it bought Countrywide Financial Corp in 2008, just before the housing crisis turned into a full-blown banking meltdown. The purchase has cost it more than $45 billion in write-downs and legal settlements.

On Wednesday, the bank said losses in its mortgage unit fell to $1.1 billion in the fourth quarter from $3.7 billion in the same period in 2012. In the year-earlier quarter, the bank reached several settlements totaling more than $5 billion with the federal government and mortgage finance giant Fannie Mae over foreclosures and bad loans.

Results in the most recent quarter were hurt by an industry-wide drop in mortgage refinancing activity, as rates have risen. The bank made $11.6 billion in home loans, down 49 percent from the third quarter.

Not all of the lingering problems from the financial crisis are behind the bank. Litigation expenses jumped to $2.3 billion in the fourth quarter from $916 million in the same period a year earlier. Chief Financial Officer Bruce Thompson said the increase was tied to mortgage securities litigation, but declined to elaborate.

Even so, the company is in a much stronger position than it was during the financial crisis, when it took two bailouts from the federal government. A measure of its capital that regulators look at, known as the Basel III capital ratio, rose to 9.96 percent from 9.25 percent in the fourth quarter of 2012, and the bank said it could last 38 months without having to tap the debt markets again.

Overall, fourth-quarter net income for common shareholders rose to $3.18 billion, or 29 cents per share, from $367 million, or 3 cents per share, in the same quarter of 2012, when profit was dented by about $5 billion in mortgage-related charges. Revenues increased 14 percent to $22.3 billion. Analysts estimated earnings of 26 cents per share, according to Thomson Reuters I/B/E/S.

"There's a company emerging from what was a pile of trouble," said Nancy Bush, a banking analyst at NAB Research LLC.

Other banks are doing well now, too. JPMorgan Chase & Co and Wells Fargo & Co both reported better-than-expected quarterly earnings on Tuesday.

Bank of America's improvement has been helping one investor in particular: Warren Buffett, whose Berkshire Hathaway Inc bought $5 billion of preferred shares and warrants from the bank in 2011, when investors were panicking about its mortgage holdings. Buffett has said he has no plans to exercise the warrants until near their expiration date in 2021; if he exercised them at current prices, he could sell the shares for an immediate $7 billion profit.

LITTLE TERRIER

Bank of America's chief executive officer, Brian Moynihan, has focused on cutting costs at the bank since he took the top job in 2010 and announced plans in 2011 to save the bank $8 billion per year. The bank is making progress toward his goals - operating costs in the fourth quarter fell by 6 percent to $17.3 billion.

"If you think back three years when he got there, nobody believed that he could do what he's done," said Bush. "He's like a little terrier. When you set him on a task, he's going to keep digging and digging till he finds the bone."

Credit costs have also been falling. The bank set aside $336 million to cover bad loans in the quarter, compared with $2.2 billion a year earlier. It released $1.2 billion from reserves to cover bad loans, compared with $900 million a year earlier and $1.4 billion in the third quarter.

As the bank's executives get other issues under control, Moynihan said last April, boosting revenue has to be the main focus.

Those efforts may be paying off. For the fourth quarter, Bank of America's global wealth and investment management business posted a 7 percent increase in revenue, to $4.5 billion, driven by higher fee income and customers depositing more funds into their accounts. Net income rose 35 percent to a record $777 million.

Revenue also rose in investment banking, where fees increased 9 percent to $1.7 billion as companies around the world took advantage of record high stock prices to raise equity capital. Bank of America executives were optimistic the bank would benefit as dealmaking activity and debt and equity underwriting increased.

"There's not one piece we look at within the pipelines that we don't feel good about," Thompson said on the call.

Revenue for global banking as a whole rose 9 percent to $4.31 billion, but net income dropped 9 percent to $1.27 billion as the company set aside more funds to cover possible losses on commercial loans.

Equity trading revenue jumped 27 percent to $904 million from a year earlier, and bond trading revenue rose 16 percent to $2.08 billion, excluding accounting adjustments linked to changes in the value of the company's debt. In bond trading, stronger results in credit and mortgage products offset weakness in rates and commodities.

(Reporting by Peter Rudegeair in New York and Anil D'Silva in Bangalore; Editing by Dan Wilchins, Ted Kerr, Jeffrey Benkoe and Leslie Adler)

By Peter Rudegeair and Anil D'Silva