U.S stocks rose in the last 30 minutes of trading, ending a volatile session higher as gains in consumer and technology shares overshadowed lingering concern over China that continued to fuel a rout in commodities. Treasuries retreated.

The Standard and Poor’s 500 Index ended Monday up 0.1 percent, after sliding to within two points of the 1,900 level earlier in the session. The Russell 2000 Index of smaller companies dropped 0.4 percent, after sinking to a level that marked a bear market. The U.S. gains came after losses in Europe and Asia amid a slump of more than 5 percent in China’s Shanghai Composite Index. Risk aversion maintained its grip on currency markets, with South Africa’s rand tumbling to a record low as oil extended its slide and copper fell.

The S&P 500 closed at 1,923.67 as of 4 p.m. in New York, as consumer staples and discretionary stocks, as well as phone and technology companies, drove gains. Last week, the index capped record slide over five days to begin a year amid a worldwide selloff sparked by concern that China’s slowdown is worse than anticipated. Even data showing resilience in the U.S. labor market couldn’t halt losses for the benchmark on Friday.

Freeport-McMoRan Inc. sank 20 percent to the lowest level in 15 years, while energy producers plunged 2.1 percent as a group. Health-care shares also retreated, with biotechnology firms leading losses.

U.S. aluminum producer Alcoa unofficially got the the U.S. reporting season under way just as markets closed, reporting better-than-expected fourth-quarter earnings amid resurgent demand for components made from the metal. Alcoa’s shares rose 1.4 percent in extended trading.

JPMorgan Chase & Co., Intel Corp. and Citigroup Inc. are among 11 companies scheduled to post their quarterly results this week. Analysts estimate profits for S&P 500 members fell 6.7 percent last quarter.

After a day of fluctuations, European stocks closed at their lowest levels since September. The Stoxx Europe 600 Index erased its gain in the final hour of trading, falling 0.3 percent as commodity producers reversed advances. The MSCI Asia Pacific excluding Japan Index slid 1.9 percent, with markets in Tokyo closed for a holiday.

Source: Bloomberg