Wells Fargo & Co , the fourth-largest U.S. bank, posted higher-than-expected quarterly earnings, helped by declining losses on commercial and consumer loans.

Several other banks also reported results that beat Wall Street forecasts and, like Wells, sounded a moderately optimistic tone.

While suffering higher credit losses than in the year-ago quarter, Wells said it saw signs that the worst was over in terms of loan write-downs, even as its outstanding loans continued to shrink.

We believe credit quality has indeed turned the corner with net charge-offs declining to $4.5 billion, down 16 percent from first quarter and down 17 percent from last year's peak quarter, and we expect this positive trend will continue over the coming year, Wells Chief Financial Officer Howard Atkins said in a statement.

Among other banks, Minneapolis-based US Bancorp said profit soared as new lending boosted revenue, while Hudson City Bancorp Inc said profit rose 11.5 percent as growth in nonperforming loans slowed.

A smaller regional bank, Dallas-based Comerica Inc , beat Wall Street earnings estimates as credit losses fell.

U.S. banks, recovering from the financial crisis, are now grappling with a dip in consumer sentiment and worries about how their business will be affected by the financial reform bill due to be signed into law by U.S. President Barack Obama later on Wednesday.

A number of provisions within this legislation will impact our company by either lowering revenue, increasing expense and/or raising capital requirements, US Bancorp Chief Executive Richard Davis said in a statement.

The banks are also struggling as consumer sentiment remains low and U.S. unemployment hovers around 10 percent.

Wells Fargo, which is in the process of integrating Wachovia Corp, acquired during the 2008 financial crisis, reported a 5 percent drop in revenue to $21.39 billion, but managed to eke out an improved net interest margin, which investors saw as a positive sign.

The story at Wells Fargo was a big improvement in credit, net interest margin expansion. Revenues in a difficult quarter were in line with the previous quarter and of course they beat on the bottom line, said Gary Townsend, president and CEO of Hill-Townsend Capital.

Net charge offs were 3.27 percent of total loans, up from 2.86 percent a year ago but down slightly from the first quarter.

LOANS

Bucking a trend among its larger rivals, US Bancorp said it made more new loans in the second quarter compared with a year earlier.

Its loan book grew 4 percent from the 2009 quarter to $191.2 billion as credit card issuance and residential mortgages increased. Quarterly revenue climbed almost 9 percent to $4.5 billion.

Loan losses increased slightly, to $1.11 billion from $929 million, but losses on commercial loans, home equity and residential mortgages broadly fell.

The bank put aside $1.13 billion against bad loans, down from $1.4 billion a year earlier.

We believe the company has reached the inflection point in credit quality and we expect net charge-offs and nonperforming assets to be lower in the third quarter than the current quarter, Davis said in a statement.

Bank of America Corp , JPMorgan Chase & Co and Citigroup Inc all reported earnings last week that were boosted by reserve releases after their credit costs eased.

Wells Fargo reported second-quarter earnings of $3.06 billion, or 55 cents a share, compared with $3.17 billion, or 57 cents a share, a year earlier.

Analysts on average expected 48 cents a share, according to Thomson Reuters I/B/E/S.

US Bancorp's second-quarter profit was $766 million, or 45 cents a share, compared with $471 million, or 12 cents a share, a year earlier.

Excluding one-items, it earned 40 cents a share, above analysts' average estimate of 38 cents, according to Thomson Reuters I/B/E/S.

Comerica reported second-quarter net income attributable to common shares was $69 million, or 39 cents a share, compared with a loss of $16 million, or 11 cents a share, last year.

Shares of Wells Fargo and US Bancorp were higher in premarket trading.

(Reporting by Elinor Comlay; editing by John Wallace)