US stocks climbed on Friday as banks made a rapid recovery following a steep fall a day ago.
Investors hoped Deutsche Bank and the financial system in general were in better shape than they had feared.
Banks made the biggest gains as Germany's largest bank tried to reassure investors about its financial health.
Investors hope Deutsche Bank will be able to negotiate down the massive cost of settling a US investigation into mortgage securities.
Energy companies rose as the price of oil continued to move higher, and strong earnings from Costco sent consumer stocks higher.
Deutsche Bank is the largest lender in Germany and investors are concerned about not only its plunging stock price, but the potential effect on the financial system if Deutsche Bank gets into serious trouble and the German government does not help it. Those fears faded on Friday.
"People came to the realisation that this isn't likely to be a big systemic risk that ripples through the financial sector," said Nate Thooft, head of global asset allocation for Manulife Asset Management.
The Dow Jones industrial average jumped 164.70 points, or 0.9%, to 18,308.15. The Standard & Poor's 500 index rebounded 17.14 points, or 0.8%, to 2,168.27. The Nasdaq composite rose 42.85 points, or 0.8%, to 5,312.
The Department of Justice wants Deutsche Bank to pay 14 billion dollars (£10.8 billion) to end an investigation into mortgage-backed securities, and the stock jumped after a report that the bank could settle the case with a smaller payment. Deutsche Bank's US-listed stock rose 1.61 dollars, or 14%, to 13.09 dollars. The stock has been pummelled this year and is trading near all-time lows.
Financial stocks tumbled on Thursday afternoon following reports that some hedge funds were moving their business out of Deutsche Bank. On Friday, bank stocks and the broader market regained almost all of those losses.
Mr Thooft said he does not think banks are in great danger but he said there are causes for concern, including the health of Italy's banks. Meanwhile, with interest rates so low and regulation getting tighter, there are plenty of reasons for investors to avoid bank stocks.
That did not stop the financial sector, the weakest sector in the market this year, from rallying on Friday. Among US banks, JP Morgan Chase added 94 cents, or 1.4%, to 66.59 dollars and Citigroup gained 1.43 dollars, or 3.1%, to 47.23 dollars.
Benchmark US crude oil rose 41 cents to 48.24 dollars a barrel in New York, and it rose 8% over the last three days. Brent crude, the international standard, slipped 18 cents to 49.06 dollars a barrel in London.
Oil prices surged this week after the nations of Opec, which collectively produce more than one-third of the world's oil, surprised investors with an agreement on a small cut in production. Investors hope energy companies will book larger profits as a result. Chevron jumped 1.65 dollars, or 1.6%, to 102.92 dollars and EOG Resources rose 1.66 dollars, or 1.7%, to 96.71 dollars.
Warehouse club operator Costco Wholesale jumped 5.02 dollars, or 3.4%, to 152.51 dollars after it reported a profit that was larger than analysts expected. Companies that make and sell household necessities also climbed. Procter & Gamble gained 1.52 dollars, or 1.7%, to 89.75 dollars and Wal-Mart rose 1.39 dollars, or 2%, to 72.12 dollars.
Cognizant Technology Solutions tumbled after the information technology consulting and outsourcing firm said it is investigating possible bribes paid to officials in India. Cognizant said it is looking into potential violations of the Foreign Corrupt Practices Act and has informed the Department of Justice and the Securities and Exchange Commission.
Cognizant also said its president Gordon Coburn resigned. The stock fell 7.37 dollars, or 13.4%, to 47.63 dollars.
Major stock indexes set records this quarter thanks mostly to tech stocks. The S&P 500 technology index climbed 12% over the last three months. Apple, the most valuable company in the S&P 500, surged 18%, partly on indications of strong sales for the newest iPhones. Microsoft, the next largest company, rose 13% and another tech giant, Google parent Alphabet, jumped 14%.
Bond prices sank. The yield on the 10-year Treasury note rose to 1.60% from 1.56%. Stocks that pay high dividends, such as utilities, property and phone companies, traded lower.
Gold fell 8.90 dollars to 1,317.10 dollars an ounce. Silver rose three cents to 19.21 dollars an ounce. Copper gained two cents to 2.21 dollars a pound.
The dollar rose to 101.41 yen from 101.07 yen. The euro rose to 1.1237 dollars from 1.1216 dollars.
Germany's Dax climbed 1% and France's Cac 40 added 0.1%. Major indexes in Asia slumped on concerns about the banking industry. Japan's Nikkei 225 slumped 1.5% and South Korea's Kospi fell 1.2%. Hong Kong's Hang Seng index sank 1.9%.