Traders work on the floor of the NYSE in New York

U.S. stocks closed higher Thursday, reversing early-session losses, on news that a group of big banks including Citigroup and Wells Fargo would deposit $30 billion to shore up regional lender First Republic Bank.

First Republic's stock, which had seen a big fall, rose on the news. Its financial health had came under scrutiny following the flash collapse of Silicon Valley bank, triggering wider concerns about the health of the banking sector.

The Dow Jones Industrial Average was up 373 points, or 1.17%; S&P 500 was up 68.41 points, or 1.76%; and the Nasdaq Composite Index was up 283.23 points, or 2.48% at Thursday close.

The buoyant mood was helped by news that Swiss bank Credit Suisse, which had seen its stock plunge Wednesday, will borrow borrow up to nearly $54 billion from the Swiss National Bank to assure short-term liquidity. It largest investor, the Saudi National Bank, had refused to step up to provide additional assistance.

Earlier in the day, Treasury Secretary Janet Yellen told lawmakers that the U.S. banking system remained sound despite the anxiety over the collapse of Silicon Valley Bank and Signature Bank.