Biotech stocks ranked among the day's biggest gainers, boosted by some strong results and drug trial data. The Nasdaq Biotech index jumped 2.2% in its fourth straight day of gains.
Apple Inc gave one of the biggest lifts to the market, rising 2.6% to $97.19 as concerns faded about the iPhone maker's margins. Dow component Microsoft Corp MSFT.O rose 0.1% to $44.87 after the company said it aimed to get its money-losing Nokia phone unit to break even within two years.
"Earnings season has been going very well, beating on both the top and bottom line, which suggests companies will continue to execute well," said Alan Gayle, senior investment strategist at RidgeWorth Investments in Atlanta.
Among the companies that reported results after the market closed, Facebook Inc posted stronger-than-expected revenue growth and its stock climbed 3.5% to $73.80 in extended-hours trading. TripAdvisor Inc shares tumbled 9.4% to $97.25 in after-hours trading after the travel website company reported earnings that missed expectations.
The shares of Dow component AT&T Inc shares slipped 1.4% to $35.38 in extended-hours trading after the No. 2 US mobile provider reported revenue that missed analysts' forecasts.
About 68.5% of the S&P 500 components have reported earnings above expectations, topping the long-term average of 63%, according to Thomson Reuters data. On the revenue side, 63.1% have beaten forecasts, above the historical average of 61%.
More From This Section
Overseas issues continued to limit the market's gains. Two Ukrainian fighter jets were downed near the area where a Malaysian Airlines passenger jet was shot down last week, a spokesman for Ukraine's military operations said Wednesday.
Violence also continued in the Gaza Strip, though US Secretary of State John Kerry said indirect truce talks between Israel and Hamas had made some progress.
"There's a battle going on in the market between earnings and geopolitical issues, and right now, it looks like earnings have a slight edge," said Gayle, who helps oversee $50 billion in assets. "These are big areas of concern, but they've yet to translate to anything tangible from an economic standpoint."
The Dow Jones industrial average .DJI fell 26.91 points or 0.16%, to end at 17,086.63. The S&P 500 gained 3.48 points or 0.18%, to close at 1,987.01, surpassing the record set on July 3. The Nasdaq Composite added 17.68 points or 0.4%, to 4,473.70.
While the S&P 500 ended at a record close, the Dow was kept under pressure by Boeing Co, which fell 2.3% to $126.71. The US aircraft maker reported a 52% jump in quarterly profit, but investors were spooked by rising costs in its military tanker program.
PepsiCo PEP.N rose 1.9% to $90.82 after the soft drinks and snacks company reported a higher-than-expected quarterly profit and raised its full-year adjusted earnings forecast.
In the biotech space, Biogen Idec reported sharply higher-than-expected quarterly revenue on surging sales of its new treatment for multiple sclerosis and raised its full-year profit forecast. Its stock shot up 11.2% to $337.60.
Intuitive Surgical ISRG.O rose 17.7% to $461.63 and was the S&P 500's biggest%age gainer a day after the company, which makes the da Vinci robot surgical system, reported second-quarter revenue that beat expectations.
Puma Biotechnology PBYI.N nearly quadrupled, up 295.4% to $233.43 on heavy volume a day after the company said its experimental breast cancer drug met its main goal in a late-stage trial.
About 55% of stocks traded on the New York Stock Exchange closed higher while 47% of Nasdaq-listed shares ended in positive territory.
About 5.33 billion shares traded on all US platforms, according to BATS exchange data, compared with the month-to-date average of 5.55 billion.