Stocks rallied on Friday, resuming their rebound from a massive selloff as Wall Street nears the end of another tumultuous week.

The Dow Jones Industrial Average rose about 320 points, while the S&P 500 gained 1.4 percent and the Nasdaq rose about 1.6 percent. Apple and Nvidia led the gains.

Falling bond yields, which rattled the markets this week, climbed back from their historic lows on Friday, easing some of the recession fears. The U.S. 30-year Treasury yield dropped to a record low on Thursday, while the yield on the benchmark 10-year notes dipped to a three-year low, as investors sought out safe-haven assets.

Bank stocks rallied with the rise in bond yields. Bank of America and Citigroup both gained more than 2 percent.

The Dow lost 800 points, or 3 percent, on Wednesday after the yield on the benchmark 10-year Treasury note briefly broke below the 2-year rate. The inversion of this key part of the yield curve has been a reliable indicator of economic recessions. That part of the curve is no longer inverted Friday.

“We have been saying this is a buying opportunity — back up the truck,” Tom Lee, Fundstrat Global Advisors’ head of research, said Friday.

Still, major stock averages are set to post their third straight weekly losses, with the Dow down 1.9 percent on the week. The S&P 500 also bled 1.7 percent so far. August has been a volatile and brutal month for the stock market as the Dow has lost more than 4 percent.

The U.S.-China trade war is still a big driver of market movements. President Donald Trump this week decided to delay some of the latest China tariffs to December, a move designed to avoid any negative impact on the holiday shopping season. The president also confirmed the two sides will hold talks next month.