The US stock market appeared to be heading for its third decline in three days - but it began to cut its losses as investors bought up oil refiners, mining companies and technology stocks.
The push was enough to nudge the Standard & Poor's 500 index into the green by half a point. The tech-heavy Nasdaq composite also finished higher.
The S&P 500 index added 0.57 points, or 0.03%, to close at 1,868.20. The Dow Jones industrial average lost 11.17 points, or 0.1%, to 16,340.08.
The Nasdaq composite rebounded in the early afternoon, gaining 16.14 points, or 0.4%, to 4,323.33.
The three major US stock indexes are still down for the week. Stocks had a strong finish last week, setting three record highs.
Investors have been worried this week about a sharp drop in China's exports in February reported over the weekend, which raised concerns that the world's second-largest economy is slowing.
Since China is a big consumer of raw materials and energy, commodities such as copper and iron ore have dropped sharply. Copper has fallen to its lowest level since 2010, but recovered somewhat today.
A dearth of major US economic news helped dampen trading today, leaving the market listless.
"When markets reach these kind of new highs very often they have to digest those gains, which is what they're doing," said Quincy Krosby, a market strategist with Prudential Financial. "They need to adjust the gains and then wait for the next catalyst to move higher."
That could come tomorrow, when new data on retail sales and weekly unemployment benefit applications are released. On Friday, a survey of consumer confidence should give traders a better sense of how Americans feel about the economy.
The state of China's economy is sure to continue to be a focus.
"We've been seeing these periodic, occasional weak data points come out of China," said Randy Frederick, managing director of trading and derivatives at the Schwab Center for Financial Research. "And each time that happens when our markets are at ... record highs, they're going to be very sensitive to any sort of negative news and there'll be days of profit-taking."
While China growth concerns appeared to hurt oil prices today, it did not stop investors from buying up oil refiners.
Tesoro rose the most of any stock in the S&P 500 index, climbing 2.13 dollars, or 4.1%, to 54.50 dollars. Marathon Petroleum added 3.21 dollars, or 3.5%, to 94.50 dollars, while Valero Energy gained 1.62 dollars, or 3%, to 55.29 dollars.
Investors also took a shine to mining companies as metals prices increased. Cliffs Natural Resources rose 43 cents, or 2.4%, to 18.41 dollars and Newmont Mining rose 66 cents, or 2.7%, to 25.01 dollars.
Tech giants Google, Microsoft and Facebook also contributed to the day's gains. Together they make up about 12% of the Nasdaq composite. Google rose 7.31 dollars, or 0.6%, to 1,207.30%; Microsoft added 25 cents, or 0.7%, to 38.27 dollars and Facebook climbed 78 cents, or 1.1%, to 70.88 dollars.
Six of the 10 industry sectors in the S&P 500 index notched small declines, with industrials posting the biggest drop. Utilities paced other gainers, as investors moved money into the relatively low-risk sector.Among the S&P 500 index's big decliners were insurer Progressive, which shed 94 cents, or 3.8%, to 23.58 dollars, and ADT, which fell 98 cents, or 3.3%, to 28.75 dollars.Most of the publicly-traded homebuilding companies were trading lower after Credit Suisse issued a broad downgrade on the sector.In addition, new data from the Mortgage Bankers Association showed home loan applications fell 2.1% from a week earlier. Meritage Homes posted the biggest drop among the decliners, shedding 85 cents, or 2%, to 44.21 dollars.Herbalife fell 4.82 dollars, or 7.4%, to 60.57 dollars after the nutrition and supplement maker disclosed that it is facing an inquiry from the Federal Trade Commission.The company made the announcement a day after hedge fund manager William Ackman renewed his attacks on the company. Mr Ackman has repeatedly bet against the company and says he believes it operates as a pyramid scheme.