"We have a habit of looking at crude as a barometer for global economic growth," said Art Hogan, chief market strategist at Wunderlich Securities. Regressive analysis by his firm showed that for the last 25 years the S&P 500 has only had a 0.03 correlation with crude. That correlation has jumped to 0.7 since crude began its plunge last June.
Among other morning reports, weekly jobless claims came in at 278,000, below estimates of 290,000 and above last week's 267,000 figure. Non-farm productivity fell a greater-than-expected 1.8 percent for the fourth quarter. Economists had forecast productivity, which measures hourly output per worker, rising at a 0.5 percent pace.
"Although none of this (data) is on the A-list, it's not bad," Hogan said. He added that oil's gains, reduction of concerns over Greece and positive corporate news also boosted markets.
Friday morning's non-farm payrolls report will show important data on growth in wages and employment. Analysts are expecting creation of 230,000 jobs.
Read MoreNew York trader: Here's how to trade S&P, oil
The Dow Jones Industrial Average gained 200 points in the minutes before the close, led by Pfizer, whose shares spiked more than 3 percent on news of its acquisition of Hospira for about $15 billion to gain access to biosimilars, copies of biotech drugs made from living cells.
Also leading blue chip gains was DuPont, whose shares rose after being halted on news that the firm named Edward Breen and James Gallogly to its board. Trian, which nominated its own slate for the board, said it refused to consider any proposal that didn't include Nelson Peltz.
The majority of S&P 500 companies that reported earnings early on Thursday beat expectations by 1 percent or more, according to The Earnings Scout.
Overseas, continued talks between Greek and euro zone leaders show that the developments are part of a negotiation, making the situation "less of a negative" for now, Hogan said, noting that investors will still be watching headlines closely for signs of risk.
Read MoreHere's what investors are watching on Wall Street
The European Central Bank's announcement late on Wednesday that revoked a waiver allowing banks to use Greek government debt as collateral for loans rattled stocks slightly before the close. The Dow Jones Industrial Average still eked out a positive gain of about 6 points, buoyed by Disney's nearly 8 percent gain.
"U.S. industrials should know that Greece should not have an impact on global markets and are trying to look past it," said Peter Boockvar, chief market analyst at The Lindsey Group.
"We'll probably see the market trade on the positive side for most of the day," said Peter Cardillo, chief market economist at Rockwell Global Capital. An S&P 500 close above 2,050 "would indicate the rally could take us up to new record highs before the end of the month."
Other analysts indicated 2,060 as the next key resistance level. The S&P 500 closed at a record high of 2,090.57 on Dec. 29, 2014.
The S&P 500 closed up 21 points, or 1.03 percent, to 2,062.52, with materials leading gains across all sectors.
Ball Corp led gains with a 9 percent rise following the company's statement relating to the possible acquisition of its UK rival Rexam. Ball is a supplier of metal packaging to the beverage, food, personal care and household products industry.
Futures held gains after digesting U.S. economic data before the bell.
Read MoreRosengren: The Fed needs to hold off on doing this
The U.S. trade deficit for December widened sharply to its highest level since 2012. The Commerce Department said on Thursday the trade deficit jumped 17.1 percent to $46.6 billion, the largest since November 2012. It was the biggest percentage increase since July 2009.
The number of planned layoffs by U.S. employers rose to a nearly two-year high in January as the energy industry slashed jobs in the face of falling oil prices, according to a report by Challenger, Gray & Christmas.
"The big reports are obviously tomorrow," said Randy Frederick, managing director of trading and derivatives at Charles Schwab. "Wouldn't be surprised if we had another day like yesterday, a fairly quiet day. Yesterday had the lowest single-day volume that we've seen in a while."
Read MoreThursday's midday movers: DuPont, FireEye & more
In corporate news, social media giant Twitter reports after the bell, as does video game maker Activision Blizzard.
FireEye moved higher on news the IT security company had been hired to help health insurer Anthem investigate its massive cybersecurity breach.
Also reporting earnings after the bell, CME Group will be in focus after the group announced plans to close most of its futures trading pits in Chicago and New York City by July 2 on Wednesday.
Read MoreWhy the CME shutting down floor trading matters
The Dow Jones Industrial Average closed up 211 points, or 1.20 percent, at 17,884.8, with DuPont and Pfizer leading gains as all blue chips advanced.
The Nasdaq closed up 48.39 points, or 1.03 percent, to 4,765.10.