Wall Street ended stronger on Thursday, with the Nasdaq up over 1 percent at a record high after earnings reports from eBay (EBAY.O) and Netflix (NFLX.O) boosted optimism.
Sentiment was also bolstered after the Greek parliament voted in favor of austerity measures.
Dour quarterly reports from Goldman Sachs (GS.N) and UnitedHealth (UNH.N), however, capped gains on the Dow.
The S&P has surged almost 4 percent from eight days ago, when widespread fears aboutGreece and a Chinese stock selloff pushed the index to its lowest level since March.
"It just proves the U.S. market continues to be resilient in the face of what seems like an endless list of global worries," said Jake Dollarhide, chief executive officer of Longbow Asset Management in Tulsa.
The Dow Jones industrial average .DJI rose 70.08 points, or 0.39 percent, to 18,120.25. The S&P 500 .SPX gained 16.89 points, or 0.8 percent, to 2,124.29.
The Nasdaq Composite .IXIC added 64.24 points, or 1.26 percent, to end at 5,163.18, just beating its previous record-high close of 5,160.095 on June 23. The S&P was also near a record high.
Nine of the 10 major S&P 500 sectors were higher, with the utilities index's .SPLRCU 1.54 percent advance leading the gainers. The materials index .SPLRCM was the lone laggard, down 0.24 percent.
After the bell, Google (GOOGL.O) jump as much as 7 percent after reporting its second-quarter revenue rose 11 percent.
The S&P 500 trades at 16.8 times forward 12-months' earnings, above the 10-year average of 14.7 times, according to StarMine data.
U.S. companies are expected to post their worst sales decline in nearly six years in the second quarter, while profit is expected to have fallen 2.9 percent, according to Thomson Reuters estimates. But expectations are low.
"What this season confirms is that we are in a modest growth and modest inflation environment," said Scott Wren, senior global equity strategist at Wells Fargo Investment Institute in St. Louis.
Netflix surged 18.02 percent to a record high of $115.81 a day after reporting strong subscribers numbers.
Citigroup reported its highest quarterly profit in eight years and its shares rose 3.77 percent to a six-and-a-half year high of $58.59.
EBay (EBAY.O) rose 3.39 percent to a record high of $65.59 after reporting better-than-expected quarterly profit and announcing the sale of its enterprise business.
But Goldman fell 0.84 percent after posting its smallest quarterly profit in nearly four years, while UnitedHealth fell 0.74 percent after missing analysts' cost estimates.
Advancing issues outnumbered declining ones on the NYSE by 2,159 to 942; on theNasdaq, 1,852 issues rose and 945 fell.
The S&P 500 posted 46 new 52-week highs and 13 new lows; the Nasdaq Composite recorded 182 new highs and 63 new lows.
Volume was light, with about 5.6 billion shares traded on U.S. exchanges, below the 6.6 billion average so far this month, according to BATS Global Markets.