Art Hogan, chief market strategist at Wunderlich Securities, noted afternoon gains in oil helped equities push higher from earlier losses. The energy sector reversed to trade briefly among advancers in the S&P 500.
Crude oil extended gains to settle up at $56.71 a barrel, the highest level so far this year. Earlier, crude briefly hit $57 a barrel for the first time since Christmas Eve. The commodity reversed earlier losses on reports of increased tension in Yemen that could pressure supply. Brent crude extended gains to trade above $64 a barrel.
"Crude is the first thing to break out of a range," said JJ Kinahan, chief strategist at TD Ameritrade, noting that a close above $56 a barrel would likely help stocks.
"The rally in oil is definitely helping markets move higher," said Lance Roberts, general partner at STA Wealth Management. "We were due for an oversold bounce in oil and that's ... providing some support to the market."
He also noted continued momentum from Wednesday's close provided some support.
Earlier, brent crude gained on increasing evidence that U.S. production is peaking, before slumping back to trade around $62 a barrel following an OPEC report.
The major indices and treasury yields have held within a range in the last few weeks of trade.
Earlier, mixed economic data and remarks by Federal Reserve officials weighed slightly as equities held to the flatline. The Dow Jones industrial average and S&P 500 tried for gains.
U.S. March housing starts showed a 0.926 million unit rate, below expectations but above February's 0.908 million unit rate.
The usual weekly initial jobless claims came in at 294,000, above expectations and a slight increase from the prior week.
"It's good to see firms don't see the need to cut workers but we still need to get (the long-term unemployed) jobs," said Tara Sinclair, chief economist at Indeed. Overall, she is still optimistic that the rest of 2015 shows strong economic growth.
The Philadelphia Fed's business outlook index for April showed 7.5, above expectations.
"I think the economic numbers were a little weaker than expected but overall that does not change the underlying story," said David Kelly, chief global strategist at J.P. Morgan Funds. He expects first quarter growth below 1 percent, followed by growth of 2.5 to 3 percent for the second quarter.
Atlanta Federal Reserve President Dennis Lockhart said in the early afternoon that he does not see the U.S. economy faltering but sees possible advantages in waiting for stronger data that would allow a steadier and more predictable path toward normal interest rate levels
The U.S. 10-year Treasury yield briefly rose to 1.92 percent following morning comments from Federal Reserve Vice Chair Stanley Fischer on CNBC that indicated enough economic growth for the central bank to begin tightening at some point.
The U.S. dollar fell about 1 percent as the euro gained to above $1.08 for the first time in a week.
Read MoreFed's Fischer: Rebound underway after 'poor' Q1
"The couple comments that I saw that I thought were worth noting—he did say the Fed would only hold off tightening if there was a very dim view of the economy," said Ian Lyngen, senior Treasury strategist at CRT.
"I think the Fed would be indifferent about (a rate hike) happening the third or fourth quarter this year or the first quarter next year, and that's what Fischer is telling us," Lyngen said. "The market is interpreting that as hinting at the sooner rather than later timing that has been bantered about by recent Fed speakers."
In Europe, equities closed lower after mixed first-quarter earnings reports and the worsening Greece situation. Standard & Poor's cut the country's credit rating to "CCC+" from "B-" with a negative outlook on Wednesday.
"At least this morning it's certainly Greece. We're seeing some contagion here today," Peter Boockvar, chief market analyst at The Lindsey Group, said earlier on Thursday. He noted gains in Italian, Spanish and Portuguese bonds.
Read MoreFueled by rising oil, stocks could take back highs
Following a slew of major financial earnings before the bell, American Express is expected to post results after the close. General Electric and Honeywell report before the open on Friday.
"Among the 10 sectors, the financial sector is the only one that has shown modest improvement in earnings expectations trends over the past year," said Nick Raich, CEO of The Earnings Scout.
He noted that beats in financial earnings temper the expected 3 percent decline in overall S&P 500 results. Although weakness in energy sector reports will likely weigh, Raich expects the decline to be less than feared.
Citigroup posted earnings per share that beat on revenues that missed expectations.
Goldman Sachs handily beat expectations on both earnings per share and revenue, helped by a burst of trading activity in January when the Swiss central bank removed a cap on the franc. The investment bank also raised its quarterly dividend to 65 cents per share from 60 cents.
BlackRock reported an 8.7 percent rise in first-quarter profit, boosted by strong flows into its exchange-traded funds (ETFs). The asset manager saw net income rise to $822 million in the first quarter, up from $756 million a year earlier.
Blackstone economic net income of $1.37 per unit, well above estimates of $1.04, with revenue also scoring a solid beat. The private equity and investment firm was helped by strong results from asset sales.
Read MoreBlackstone CEO: We're an 'earnings machine'
UnitedHealth earned $1.46 per share for its latest quarter, 11 cents above estimates, with revenue also beating Street expectations. The insurer also raised its 2015 earnings forecast, following stronger business growth during the first quarter.
TD Ameritrade's Kinahan noted that strength in financials and health care earnings, followed by positive tech sector reports later in the season, would be good indicators for a "broad-based rally."
Netflix surged more than 18 percent to a new all-time high on Thursday. The firm reported earnings after the bell on Wednesday that missed on the earnings per share but its stock gained in after-hours trade as revenues grew 24 percent and it added more subscribers than expected.
Steve Weinstein, managing director at ITG Investment Research, said the subscriber growth and reduction in turnover was encouraging.
"People are not cancelling the subscriptions at the rates they used to," he said.