Wells Fargo, the biggest U.S. mortgage lender, said Friday its second-quarter profit surged 20 percent as it cut expenses.

Net income rose to $5.27 billion from $4.40 billion a year earlier. On a per-share basis, earnings were 98 cents, beating the 93 cents forecast by Wall Street.

Revenue edged up to $21.4 billion from $21.3 billion and exceeded Wall Street expectations.

The bank lowered expenses in the second quarter by $142 million, to $12.3 billion.

"Wells Fargo again demonstrated an ability to grow during a dynamic economic and interest-rate environment," the bank's chairman and CEO, John Stumpf, said in a statement.

The bank's stock price was up 76 cents, or 1.8 percent, at $42.65 before regular trading began Friday.

San Francisco-based Wells Fargo controls nearly a third of the U.S. mortgage market, and that has helped bolster its earnings in recent quarters. It funded $112 billion worth of mortgages, down from $131 billion in the second quarter of 2012. With interest rates on mortgages rising sharply in recent weeks, analysts are concerned about the potential impact on the bank's mortgage business. Much of its recent lending came from refinancing, which has been reduced by the recent spike in rates.

Mortgage rates jumped late last month from near-record lows and added thousands of dollars to the cost of buying a home, after the Federal Reserve signaled that it could slow its bond purchases later this year. The average rate on the 30-year fixed loan rose this week to 4.51 percent, the highest in two years.

In the short run, higher rates appear to be drawing potential home buyers off the sideline. Buyers want to get a mortgage before rates rise further from their historically low levels. In the long run, more expensive home loans might slow the housing market's recovery, which has helped drive the U.S. economy.

At the same time, higher loan rates would allow banks to make more from mortgage lending.

Wells Fargo, the fourth-largest U.S. bank by assets, was little known outside the Western U.S. before scooping up a teetering Wachovia in the depths of the financial crisis in 2008. The bank has turned a profit every quarter since 2009, the year it wrapped up its acquisition of Wachovia.