The S&P 500 closed about 1 point higher at 1,881, with utilities leading advancers and energy falling more than 2 percent as the greatest decliner. In afternoon trade, the index briefly fell below 1,867, its low from August that many traders are watching as a support level. The index breached the level in intraday trade Friday but ended above, at 1,880.
Also weighing on stocks in afternoon trade was a Reuters headline that the "Saudi foreign minister refuses to rule out seeking a nuclear bomb if Iran manages to obtain one." However, in the actual quote the minister said it would not be logical to discuss the issue in public and that it wouldn't be reasonable to answer the question one way or another.
"(The headline) exacerbated the last leg down but I don't think beyond today or this afternoon it means much," said Jeremy Klein, chief market strategist at FBN Securities.
For Klein and several other analysts, the next level after the August low is the October 2014 low of 1,820.
The Dow Jones industrial average closed about 28 points higher, holding little of its opening gains of more than 180 points but more than recovering from a roughly 88-point dip in afternoon trade. UnitedHealth and McDonald's contributed the most to gains, while Exxon Mobil and Chevron were the greatest weights on the index.
The Dow transports gave up opening gains to close about half a percent lower.
Stocks opened higher as oil gained and softer Chinese data spurred some hopes of further monetary stimulus. Asian markets closed higher, with the Shanghai composite up more than 3 percent. European stocks held more than 1 percent higher.
Overnight, China reported GDP of 6.9 percent for 2015, the slowest pace since 1990. Fourth-quarter GDP growth was 6.8 percent year-over-year, a touch below expectations. December retail sales showed 11.1 percent growth from the same period last year, while industrial production grew 5.9 percent. Both were mildly below estimates.
Read MoreGartman: Why any stock bounce will be short-lived
"I think the Chinese numbers weren't that great. They weren't that bad. They were kind of in-line with expectations," said James Meyer, chief investment officer at Tower Bridge Advisors. "I think the fear on Friday was overdone a bit and we're seeing a little relief rally"
"I wouldn't read anything more into this than a relief rally," he said. "We're not out of the woods yet. We have entered a period of very slow worldwide growth."
On Tuesday, the International Monetary Fund cut its global economic growth forecast for 2016 to 3.4 percent, down from prior forecasts but up from a 3.1 percent forecast for 2015.
Read More IMF: We were right on China—here's what's next
Analysts also noted support for initial gains in stocks from encouraging Bank of America, Morgan Stanley and UnitedHealth earnings.
"I do think some of the bank earnings have come in a little better than feared and that certainly has helped," said Nick Raich, CEO of The Earnings Scout.
IBM, and Netflix are among the firms due to report after market close.
Read MoreThese are risks for markets in week ahead
In economic news, the NAHB housing index held steady at 60 in January, but from a downwardly revised December reading and off a recent high of 65 in October.
Treasury yields edged higher, with the 2-year yield at 0.88 percent and the 10-year yield at 2.05 percent.
"The movement that we've seen (in the Treasury market) revolves around the path the Fed is going to take," said Bryce Doty, senior fixed income manager with Sit Investment Associates. He added that any stability in equities encouraged a view of a faster pace of Fed tightening.
The U.S. dollar traded mildly higher against major world currencies, with the euro above $1.09 and the yen at 117.59 yen against the greenback.
Oil hit fresh 12-year lows amid continued concerns about oversupply. The International Energy Agency said Tuesday that supply continues to exceed demand, placing "enormous strain" on the ability of the oil system to absorb it efficiently and putting further pressure on oil prices.
U.S. stock markets were closed Monday for the Martin Luther King, Jr. holiday. Stocks closed more than 2 percent lower Friday for the S&P 500's and Dow Jones industrial average's worst 10-day start to a year on record.
As of Tuesday's close, the S&P 500 was down nearly 8 percent for the year so far.