Profits at Wells Fargo ( WFC) rose 12% from a year ago, but fell shy of Wall Street expectations.

The San Francisco-based lender earned $1.71 billion, or $1 a share, in the quarter, compared to $1.53 billion, or 90 cents a share, a year ago. Earnings were fueled by continuing improvement on the bad loan front and increased fees from customer deposits and credit cards.

Per-share earnings fell 4 cents shy of the Thomson First Call consensus estimate of $1.04 a share.

Revenue at Wells rose 7% to $7.4 billion, exceeding the average analyst estimate of $7.3 billion.

In the quarter, Wells said it took a number of steps to reposition its balance sheet and investment portfolio in light of the trend toward rising interest rates.

As previously disclosed, the bank repurchased $2.4 billion in long-term debt, which reduced pretax earnings by $176 million. Wells also incurred a $222 million loss on the sale of $14 billion in securities and adjustable-rate mortgages. The actions resulted in a 14-cent hit to per-share earnings in the quarter.

"To the extent the markets remain as volatile as they were in the second quarter, we may take advantage of additional opportunities to further improve asset yields or reduce long-term funding costs in the future,'' said Wells CFO Howard Atkins in a press release.

Net interest income rose 7% to $3.78 billion, while noninterest income rose 8% to $3.2 billion. Total noninterest expense rose 5% to $4.3 billion.

The bank posted strong loan growth both on the consumer and commercial side, a combination that many banks have not been able to achieve during the economic recovery. Average commercial and commercial real estate loans increased $5.1 billion, or 6%, compared to a year ago. Average consumer loans increase $56 billion, or 48%.

"Commercial loan growth this quarter was broad-based across virtually all of our segments,'' said Atkins.