March 7 (Reuters) - U.S. regional lenders face ongoing challenges from rising deposit costs and risky office-building loans a year after the biggest bank failures since 2008.

The unexpected collapses of three banks - Silicon Valley and Signature in March 2023 and First Republic in May - put a spotlight on how lenders managed risks to assets and liquidity as the Federal Reserve raised interest rates aggressively to bring surging inflation under control.

Now that the Fed has stopped raising rates but has signaled cuts may not come for another several months, investors have shifted their focus to the potential for customers to pull their deposits in times of stress, while gauging lenders' exposure to the troubled commercial real estate (CRE) sector.

"The banking industry needs to make sure it has a strong hold on its access to liquidity, conduct in-depth deposit stress testing, and ensure it can withstand significant stress," said Ryan Nash, banking analyst at Goldman Sachs. "This is something that all banks will need to plan for in the world ahead.”

The tumult prompted emergency government measures to stabilize the sector alongside downgrades by credit rating agencies. In recent weeks, New York Community Bancorp has fueled market jitters about renewed weakness in the sector after it disclosed major losses and warned of material weakness in its internal controls.

"Last year’s bank stress underscores the importance of not becoming complacent," Cleveland Fed President Loretta Mester said in New York City last week, noting that the bank failures were due not just to poor risk management but also to weaknesses in supervision.

The following graphics show the impact of Silicon Valley Bank's (SVB) collapse on the industry, one year after its March 10 failure.

In its immediate aftermath, business lending plunged and banks pulled back on credit more broadly.

In recent months, both measures have improved, but are still below year-ago levels.

Commercial lending has bumped along in recent months, barely regaining lost ground after SVB's failure.

Regional banks have relatively large exposure to CRE loans, compared with larger peers that have more diversified portfolios. Lenders are under pressure to write down their losses from CRE as offices remain sparsely populated by workers on hybrid or remote work arrangements.

Growth in CRE lending slowed dramatically after SVB's failure and continued to decelerate through the year. Loans by regional and community banks, which account for the bulk of CRE lending, are still above last year, but the biggest banks have trimmed their CRE loan portfolios.

Recent Boston Fed research suggests that, even so, it may be the biggest banks that are more vulnerable to CRE losses, with 40% of their office building loans in counties with a high share of work-from home, versus 30% for smaller banks.

The turmoil of March 2023 triggered "stress for most, crisis for a few" banks, said Christopher Wolfe, head of North American Banks ratings at Fitch. It highlighted the importance of banks maintaining solid insured and operational deposits to underpin their funding.

"The banks most caught out were material outliers," in terms of their sources of deposits, he said.

Depositors fled smaller U.S. lenders for the safety of bigger institutions after SVB failed, but some funds have since flowed back.

Overall deposits in banks of all sizes are down compared with a year earlier as households have spent their savings or chased higher returns in money markets or rallying equities.

More than 90% of Silicon Valley Bank's deposits were not insured by a Federal Deposit Insurance Corp guarantee, which covers at least $250,000 in deposit accounts.

SVB's uninsured deposits stood at twice the average of its peers. It was toppled after clients who were concerned about the bank's health pulled their money, regulators found.

Since last year, the proportion of uninsured deposits in the industry has declined, FDIC data shows.

"When your customer deposit base is making big withdrawals over the short term, it will definitely cause a liquidity squeeze," said Stephen Biggar, analyst at Argus Research.

"No amount of capital levels will be able to save a bank that has 40% of their deposits leave in 24-48 hours."

Investors generally expect regional bank stocks to be more volatile than stocks of bigger banks and larger financial institutions.

For this reason, there tends to be a gap between the implied volatility of regional stocks and larger banks. This gap, which widened sharply during the March turmoil, has not gone back to pre-crisis levels. The spread reflects investors' lingering perception that regional banks are a less safe bet than bigger lenders.

"The risks facing regional banks right now would be an environment of higher-for-longer rates," said Richard Saperstein, chief investment officer of Treasury Partners. As banks pay more to retain customer deposits, the money they earn from interest payments is eroded, he said, referring to a measure called net interest margin.

Saperstein expects more banks to set aside reserves for potential losses on CRE loans, particularly related to offices. He also predicts ratings agencies will continue to downgrade regional lenders.

Regional banks in particular saw a decline in net interest income as they had to pay more to depositors versus larger peers while demand from borrowers stays subdued.

The stocks of regional lenders were hit when SVB's troubles first emerged, and have lagged the overall U.S. equity market over the past year.

The KBW Regional Banking index has slumped roughly 12% since the banking issues first flared in March 2023, while the S&P 500 - the benchmark for the U.S. stock market - has gained 28% in that time, fueled by huge gains for megacap technology and growth stocks.

The S&P 500 banks index, which includes major banks such as JPMorgan Chase and Wells Fargo, has fared better, rising some 12% over the past year, though still trailing the overall S&P 500.

(Reporting by Ann Saphir in San Francisco, Saeed Azhar and Lewis Krauskopf in New York; additional reporting by Saqib Iqbal Ahmed and Niket Nishant in Bengaluru, editing by Lananh Nguyen, Megan Davies and Nick Zieminski)