A rebound in the healthcare sector helped steady stocks on Wall Street, pushing the Standard & Poor's 500 index to its first gain in six days.
Drugmakers including Edwards Lifesciences and Medtronic were among the biggest gainers as the industry group rebounded from a sharp slump the day before.
The gains for the overall market were small. Stocks flitted between modest gains and losses for most of the day before closing slightly higher.
The market remains close to its lows for the year and is set to close out September with its worst quarterly performance in four years.
Concerns that China's economy is slowing more rapidly than previously thought have hurt the market.
Investors are also preoccupied with the outlook for US interest rates. Federal Reserve policymakers have said they will probably raise interest rates before the end of the year.
Some investors see a rate increase as a vote of confidence in the US economy. Others think it would be a mistake to raise borrowing costs just as the global economy is showing signs of flagging.
"The Fed is still, as it has been for over a year now, the number one thing that's overriding the market," said JJ Kinahan, chief strategist at TD Ameritrade.
"There's just so much skittishness, people just don't have confidence."
The S&P 500 rose 2.32 points, or 0.1%, to 1,884.09. The index slumped 50 points the day before and is down 8.7% for the third quarter.
The Dow Jones industrial average climbed 47.24 points, or 0.6%, to 16,049.13 The Nasdaq composite dropped 26.65 points, or 0.6%, to 4,517.32.
Biotechnology stocks have been a weak spot for the stock market recently. The sector has slumped on concern that politicians will seek to implement new regulations to curb price hikes in the industry.
On Tuesday, the Nasdaq Biotechnology Index edged down 0.6%, its eighth successive day of losses. The index has slumped 27% from its peak in July, putting it in a bear market, Wall Street terminology for a drop of 20% or more.
Brad Sorensen, a director at the Schwab Centre for Financial Research, said he was not surprised by the sell-off in biotech stocks given how sharply valuations have climbed in recent years.
"The biotech industry was concerning to us," he said. "It clearly had bubble-like characteristics with a lot of speculative money moving into it and a lot of IPOs."
Yahoo was among the stronger stocks on Tuesday.
The stock rose 66 cents, or 2.4%, to 28.26 dollars after the company said that it still planned to spin off its stake in China's Alibaba Group.
Yahoo is moving ahead with the plan even though the IRS has yet to rule on the tax payments that the company could face from the gains on its initial investment.
Investors also got some good news on the economy from a report showing that American consumers were feeling more confident this month.
The Conference Board, a business research group, said that its consumer confidence index rose to 103 in September after surging in August to 101.3. The September reading was the highest since January.
The price of oil rose on expectations that the energy department will report a slowdown in US crude production when it releases its monthly petroleum supply report today.
US crude rose 80 cents to close at 45.23 dollars a barrel in New York. Brent Crude, a benchmark for international oils used by many US refineries, rose 89 cents to close at 48.23 dollars a barrel in London.