Wells Fargo & Co swung to a fourth-quarter profit on a pickup in fee income, even as it repaid $25 billion in bailout funds to the U.S. government.

The fourth-largest U.S. bank by assets reported a profit of $2.82 billion, or 8 cents a share. Analysts on average expected a loss of 1 cent a share, according to Thomson Reuters I/B/E/S.

In the fourth quarter of 2008, excluding the impact of Wachovia Corp, which Wells Fargo bought at the end of the year, it reported a loss of $2.73 billion, or 84 cents a share.

While analysts broadly view the San Francisco-based bank as among the stronger survivors of the financial crisis, it is facing mounting losses on Wachovia mortgage portfolios.

Loan losses jumped to $5.9 billion in the fourth quarter from $3 billion a year earlier, driven by residential and commercial mortgage losses.

But the bank set aside just $5.9 billion against loan losses in the quarter, compared with $8.4 billion a year earlier.

Chief Financial Officer Howard Atkins said losses from Wachovia are tracking better than originally estimated at the time of the merger.

Offsetting credit losses was a surge in revenue from the bank's fee-based businesses, such as investment management and mortgage servicing. Noninterest income climbed to $11.2 billion in the fourth quarter from $2.8 billion, excluding Wachovia, a year earlier.

Wells Fargo shares climbed 3 percent in premarket trading to $29.10.

Last month Wells Fargo repaid a $25 billion government bailout it received in October 2008 under the Troubled Asset Relief Program. The bank sold $12.25 billion in stock to help fund the repayment.

(Reporting by Elinor Comlay; editing by John Wallace)