NEW YORK - U.S. bank executives said they're optimistic on loan growth as demand for borrowing from retail and business customers bounced back in the second quarter from the lows of the pandemic, but warned demand could weaken later this year if the worsening economic outlook starts to hurt consumer confidence.

Analysts and investors have been carefully watching loan growth, a core driver of bank income, after extraordinary government stimulus during the COVID-19 pandemic dampened companies' and consumers' appetite for bank borrowing.

As the economy bounced back from the pandemic, demand for loans began to pick up in the first quarter driven by consumer spending and companies bulking up inventories. That trend continued during the second quarter, despite aggressive U.S. Federal Reserve interest rate rises sparking recession fears.

JPMorgan Chase & Co and Wells Fargo & Co, two of the biggest U.S. lenders, said that their loan books grew in the second quarter by 7% and 8.4%, respectively, compared to last year, with few signs of deteriorating credit quality.

During second-quarter earnings calls on Thursday, executives at JPMorgan - the country's largest lender - said they expect loans to grow by the mid- to high-single digits this year.

That growth and Fed rate rises were good news for banks, boosting net interest income, the difference between the interest earned on loans and paid out on deposits.

Citigroup, for example, said gross loan yield had risen for the prior five consecutive quarters to reach 5.81% in the second quarter.

"Results in 2Q22 so far reinforce our positive view," wrote analysts at Wells Fargo, citing strong credit quality, growth in loans and a 10% quarter-on-quarter rise in net interest income. They said commercial loans are showing the best growth in 14 years.

Wells Fargo, JPMorgan and Citigroup all said corporate clients borrowed more in the second quarter, often to cover increased costs created by soaring inflation. JPMorgan, for example, saw strong growth in corporate and industrial loans, which grew 6% on higher use of revolving facilities and new accounts opened, while commercial real estate loans grew 3%.

Citigroup said loans in its Institutional Clients Group grew 3%, with executives noting that some of that was driven by a surge in market volatility sparked by the conflict in Ukraine.

"We are seeing an increase of lending as our clients have been less inclined to obtain financing through the debt markets given the recent swings," Citi CEO Jane Fraser told analysts.

Kenneth Leon, research director, industry and equities at CFRA Research, said he expected commercial loan growth would be flat in the second half, while consumer loans would likely decline given the risk of recession, even if only a shallow one.

While a slump in mortgage lending due to rising rates was a drag on consumer lending portfolios, credit card loans were way up, with JPMorgan and Wells Fargo both reporting a 17% jump.

Average loans for Citi's personal banking and wealth management division, which includes cards, rose roughly 4% from a year ago.

Bank executives said credit quality remained very high, but warned inflation will likely dampen consumer spending.

"I don't think what we've seen in the second quarter will continue to happen at the same pace," Wells Fargo Chief Financial Officer Mike Santomassimo told analysts.

Morgan Stanley said its loans grew by $7 billion year-on-year, driven primarily by wealth management clients taking out mortgages or loans backed by their investments.

But even among those well-heeled clients, borrowing is expected to wane as rates rise, making mortgages more expensive, and as slumping markets reduce the value of equity investments, said the bank's CFO Sharon Yeshaya. "We really have not seen yet any major cracks as it relates to the health of the consumer," said Leon. "Credit quality is still very good but that will probably shakeout sometime next year."

(Reporting by Elizabeth Dilts Marshall; editing by Michelle Price and Nick Zieminski)