U.S. stocks closed higher Thursday, as a rise in oil and gains in Facebook outweighed pressure from declines in biotech stocks and concerns about economic growth. (Tweet This)
The major averages ended off session highs but recovered from an intraday dip into negative territory.
"It's really Facebook and Amazon that are driving the market but my real concern as we pull back from the highs is this market is going to run up to resistance on any rally," said Marc Chaikin, CEO of Chaikin Analytics. "The inability of the market to hold up on good news (from stocks) like Facebook, which is a key player, is not good news."
U.S. crude oil futures settled above $33 a barrel, well off session highs but notching oil's first three-day win streak of 2016.
"A lot of what's going on in markets today is this uncertainty in oil and commodity prices and how that's going to affect (energy companies)," said John Bredemus, vice president, Allianz Investment Management. That analysis gets easier "if we can get a solid basis of where energy prices will be."
Earlier, the major U.S. averages fell into negative territory as declines in health care stocks weighed.
The iShares Nasdaq Biotechnology ETF (IBB) closed down 3.66 percent. Earlier, the ETF fell more than 5 percent to drag the Nasdaq composite into negative territory.
Paul Yook, portfolio manager at BioShares Funds, attributed the declines in IBB to disappointment on earnings. "Generally, companies were pretty conservative with their guidance," he said.
"It's just been obviously the worst beginning to the year for biotech and investors are really fleeing and staying on the sidelines until they see some stabilization (in stock prices)," he said.
As of the close Thursday, IBB was down 22 percent for January and the year so far, on pace for its worst month ever. Year-to-date, the Nasdaq composite was off 10 percent, while the S&P 500 was down 7.37 percent. Health care fell 2.3 percent as the only S&P decliner Thursday and was the third-worst performer in the index for the year so far.
"My sense is it's going to take some more catalysts to turn things around. Unfortunately, fourth-quarter earnings season is not doing it," said Mike Bailey, director of research and chair at FBB Capital Partners. He said biotech stocks may not find a boost until first-quarter reports or product approvals come later in the year.
Celgene closed nearly 5 percent lower after posting fourth-quarter earnings that fell short of analysts' estimates, hurt by higher costs. The company's net profit fell to $561 million, or 69 cents per share, in the fourth quarter, from $613.9 million, or 74 cents per share, a year earlier, Reuters reported. The firm's current quarter earnings guidance was slightly below FactSet expectations.
Eli Lilly closed 6 percent lower. The drug maker posted earnings in-line with estimates on revenue that beat. Lilly said it is upbeat about this year's prospects based on a half dozen Food and Drug Administration approvals in 2015 and a number of successful late-stage trials.
With Thursday's 15.5 percent gain, Facebook is up 4.25 percent year-to-date, one of the 80 S&P 500 stocks that are positive for the year so far.
Facebook reported earnings after the close Wednesday that blew past estimates, with the firm beating the $1 billion mark in quarterly net income for the first time ever.
Caterpillar reported adjusted fourth quarter profit of 74 cents per share, five cents above estimates, though revenue was light. Caterpillar does see full-year 2016 profit above current Street estimates, as it benefits from cost controls and restructuring. Shares closed 4.7 percent higher but are still off about 10 percent for the year so far.
Energy gained 3.15 percent to lead the S&P 500 higher. The index closed about half a percent higher, but well off an opening spike of more than 1 percent. The S&P is on pace for its worst month since May 2010.
"The huge higher open was clearly around oil prices higher and the talk about OPEC cutting production," Bredemus said.
"I think the reality is setting in. I think reality is, after the Fed, is the Fed isn't seeing anything better than we are," he said. "It's earnings season. Things are slow, things aren't going as well as we hoped and oil is uncertain."
Earlier, Dow futures jumped more than 150 points in pre-market trade, shaking off pressure from a sharp miss on durable goods, as oil gained.
"Obviously, certainly crude is driving the bus," said Jeremy Klein, chief market strategist at FBN Securities. He also noted support for stocks from some encouraging earnings reports and expectations the Federal Reserve will hold off on raising rates in the near-term.
Oil gained on speculation that major producers may cooperate to cut production.
U.S. crude settled up 92 cents, or 2.85 percent, at $33.22 a barrel, after earlier topping $34.50 to its highest since Jan. 6. Brent settled up about 2.4 percent at $33.89 a barrel, for its first three-day win streak since November.
Russian Energy Minister Alexander Novak said Thursday that Saudi Arabia had proposed to cut oil production by up to 5 percent by each country in order to support weak oil prices, Reuters reported.
But Saudi Arabia has not proposed cutting back production or asked Russia to do the same, Dow Jones reported, citing a senior Gulf OPEC delegate.
Dow futures briefly turned negative in pre-market trade after December durable goods orders declined far more than expected.
"While it wasn't good news, it was also not new news. I don't think that set the tone for today," said Kate Warne, investment strategist at Edward Jones.
Durable goods fell 5.1 percent in December, far more than expectations for a less-than 1 percent decline. Ex-transportation, the figure declined 1.2 percent.
"That's another indication the economy is continuing to slow and an indication the Fed is going to hold off in the first half of this year," said Peter Cardillo, chief market economist at First Standard Financial.
Weekly jobless claims came in at 278,000.
Pending home sales rose just 0.1 percent in December from a downwardly revised November print.
Treasury yields briefly turned higher as oil surged before holding lower, with the 10-year yield at 1.98 percent and the at 0.81 percent.
The Treasury auctioned $29 billion in 7-year notes at a high yield of 1.759 percent.
The U.S. dollar held about 0.3 percent lower against major world currencies, with the euro around $1.095 and the yen at 118.83 yen against the greenback.
U.S. stocks fell more than 1 percent Wednesday after the Federal Reserve meeting statement renewed concerns about global growth. Disappointing earnings reports from Apple and Boeing also weighed heavily on stocks, despite gains in oil prices.
"I think they're trying to convey a very nuanced message and investors were looking for something that would say they wouldn't raise rates at the March meeting," Warne said.
The closed up 10.41 points, or 0.55 percent, to 1,893.36, with energy leading nine sectors higher and health care the only laggard.
The Nasdaq composite closed up 38.51 points, or 0.86 percent, at 4,506.68.
The Dow transports fell 0.8 percent.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, held near 22.5.
About two stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of nearly 1.1 billion and a composite volume of almost 4.7 billion.
Gold futures for April delivery settled down 20 cents at $1,116.10 an ounce.
—Reuters and CNBC's Peter Schacknow contributed to this report
On tap this week:
Earnings: Amazon.com, Amgen, Microsoft, Visa, Electronic Arts, KLA-Tencor, Western Digital
Earnings: AbbVie, Chevron, Colgate-Palmolive, Honda Motor, Honeywell, MasterCard
8:30 a.m. Real GDP Q4; international trade; employment cost index
9:45 a.m. Chicago PMI
10 a.m. Consumer sentiment
3:30 p.m. San Francisco Fed President John Williams on panel
*Planner subject to change.
More From CNBC.com: