Stocks closed off session lows as blue chips gained traction amid concerns about the impact of a Chinese ban on Apple Inc.'s iPhone on the big tech industry, which has driven this year's market rally.

The S&P 500 cut losses by more than half, led by gains in defensive sectors such as utilities and health care. The Dow Jones Industrial Average gained ground. The Nasdaq 100 underperformed because Apple fell 6.5% in two days. Suppliers such as Qualcomm and Micron Technology also suffered losses. Small-cap stocks were under pressure, with the Russell 2000 breaking through a critical technical level.

In 2023, tech stocks soared amid the artificial intelligence frenzy and speculation that the Federal Reserve is nearing the end of its interest-rate hikes. According to some metrics, the Nasdaq 100's nearly 40% rise suggests that valuations are stretched, and the market is due for a correction.

Traders also kept a close eye on the latest economic data, with strong jobless claims figures reinforcing the Fed's case for keeping rates high.

After briefly rising in the aftermath of the report, two-year US yields fell below 5%. The dollar rose slightly after reaching a nearly six-month high earlier this week.