The Nasdaq closed up 20.89 points, or 0.41 percent, at 5,056.06.
Apple closed up nearly 1 percent to lead the Nasdaq higher ahead of the release of the Apple Watch on Friday. The iPhone maker also posts quarterly results on Monday after the bell.
The Nasdaq iShares biotechnology ETF (IBB) gained more than 1 percent in another boost to the Nasdaq.
Comcast shares spiked to a new intraday high on reports the firm could drop its bid for Time Warner Cable as early as Friday. Other media stocks also moved on the news.
Leading the blue chips, IBM closed up 2.95 percent after spiking more than 3.5 percent on positive follow-through from its earnings report on Monday. Overall revenue fell 12 percent in a continuing downward trend, but sales in the cloud and analytics segments rose 60 and 12 percent year over year, respectively.
Investors are "looking at it as a company that's turning around and showing some progress as it's turning around," said Paul Nolte, portfolio manager at Kingsview Asset Management.
In the S&P 500, AT&T jumped more than 4 percent after reporting earnings after the close Wednesday that beat estimates on revenue that came in slightly below expectations. The telecommunications firm said subscribers switched to other networks at a lower rate. The company also launched a $17.5 billion six-tranche bond to finance its acquisition of DirecTV.
Corporate news and the highest settlement in crude for 2015 sent telecommunications and energy higher to trade among the advancers in the S&P 500.
Earlier, stocks traded mildly lower, following a negative lead from index futures.
"I think the market, in the absence of anything, is trading off technicals," said Mark Luschini, chief investment strategist at Janney Montgomery Scott. "The market I think is looking at the various technical levels and is looking at whether it is going to break up or break down. It seems to want to go higher but every time it reaches the 2,108 level it breaks down."
Read MoreIs China heading for another interest rate cut?
Katie Stockton, chief technical strategist at BTIG, said in a note that "we expect upside follow-through in the days ahead to allow the SPX to break out from its triangle formation to a new all-time high. So far, earnings season is driving more breakouts on the charts than breakdowns, so we think it is only a matter of time before this is reflected by the major indices."
On Wednesday, the Nasdaq closed up within 15 points of its all-time closing high of 5,048.62. The S&P 500 closed within 10 points of its closing high of 2,117.39.
"I think we're in a period of consolidation," said Terry Sandven, chief equity strategist at U.S. Bank Wealth Management. "Equities have been grinding higher. Companies are looking for clarity into whether or not earnings have been set too low."
Among the slew of industrial earnings reports before the bell, Caterpillar surprised analysts by beating expectations on both earnings per share and revenue. The stock spiked 1.5 percent in morning trade.
CEO Doug Oberhelman said on CNBC's "Squawk Box" that the United States was a bright spot in terms of construction growth. However, he said investors should not expect a repeat of this quarter. The firm raised its earnings forecast while maintaining its revenue outlook.
"I don't extrapolate anything out of Caterpillar," said Peter Boockvar, chief market analyst at The Lindsey Group, noting negative reports from other industrials. "Not one of them is going to drive the market. ... It's very much a mixed bag. The market is looking for direction and we may have to wait until next week's Fed meeting."
The Federal Reserve meets next Tuesday and Wednesday but will not hold a press conference.
Dunkin' Brands jumped more than 8.5 percent after the firm reported better-than-expected first-quarter revenue and profit.
3M fell more than 3 percent after reporting earnings that missed expectations on both the top and bottom line. The company cited the impact of the strong dollar and cut its profit forecast for the year.
Read MoreEarly movers: PBR, MMM, CAT & more
General Motors closed down 3.3 percent after the firm delivered quarterly profit and revenue that missed expectations. Weaker volume in Brazil and Russia hurt sales, as well as the impact of weakening currencies in South America due to the strong U.S. dollar.
PepsiCo closed down about 1.6 percent after reporting a revenue decline of 3.2 percent to $12.22 billion in the first quarter ended March 21, from $12.62 billion a year earlier, largely due to a strong dollar. However, quarterly earnings topped analysts' expectations.
"Eventually, missing revenues and the increased warnings outlook from major companies, I think it eventually will affect stocks," said Peter Cardillo, chief market economist at Rockwell Global Capital. He expects stocks to eventually move lower.