NEW YORK — Wells Fargo & Co. on Tuesday said that its second-quarter profit rose 30 percent, as the number of uncollected loans and credit card bills dropped sharply, enabling the bank to release a big chunk of the money set aside to cover bad lending.

Its shares rose more than 2 percent in premarket trading.

The San Francisco bank said net income for the three months ended June 30 rose to $3.73 billion, or 70 cents per share, compared with $2.88 billion, or 55 cents per share, in the year-ago quarter.

Analysts, on average, were expecting profit of 69 cents per share, according to data provided by FactSet.

Total revenue fell 5 percent to $20.39 billion from $21.39 billion last year. That was short of the $20.43 billion Wall Street was expecting.

Revenue in its largest segment, community banking, fell 8 percent to $12.57 billion. Total loans fell 2 percent to $751.92 billion, but in a bright spot, core deposits rose 7 percent to $808.97 billion.

Net interest income, or the money earned from deposits and loans, fell 7 percent to $10.68 billion from $11.45 billion last year. Noninterest income, or money earned from fees and investments, slipped 2 percent to $9.71 billion from $9.95 billion last year.

Wells Fargo does not rely as heavily on investment operations as most of the nation's other big banks, which have leaned on gains in that arena to offset weakness in retail banking operations. But it did report a 7 percent rise in trust and investment fees to $2.94 billion, which helped boost noninterest income.

The biggest benefit for Wells, however, came from improvement in its lending business.

The amount of loans it had to write off as uncollectible, known as charge-offs, dropped to $2.84 billion from $4.49 billion last year. Better results came in both commercial and consumer loans, including home mortgages and credit cards. Nonperforming assets, or loans and credit cards considered past due and in danger of default, fell 15 percent to $27.91 billion from $32.81 billion last year.

The sharp decline in write-offs allowed the bank to release $1 billion from its loan-loss reserves, the money set aside to cover bad loans. That provided a significant boost to earnings.

The bank said it has completed the conversion of its Wachovia branches in Pennsylvania and Florida to the Wells Fargo name, and the remaining branches in Eastern markets will be converted by year end. Wells bought Wachovia in the fall of 2008 amid the economic collapse.

Wells also said it bought back 35 million shares in the second quarter after getting the go-ahead from the federal government to restart its repurchase program.

In premarket trading, Wells Fargo shares gained 55 cents, or 2.1 percent, to $27.43.