US stocks finished sharply higher on Monday, with the Dow Jones industrial average re-emerging in positive territory for the year, after euro zone leaders reached a tentative deal to bail out Greece.
The improved European picture led to best three-day run this year for the S&P 500 and Nasdaq Composite.
Facebook, Netflix and Amazon all hit record highs, while Apple's 1.93 percent rise gave the biggest boost to the Nasdaq.
Greece won conditional agreement to receive a possible $95 billion over three years, along with an assurance of talks to bridge a funding gap until a bailout is ready. The deal is contingent on Greece meeting a tight timetable to enact strict reforms.
"Headlines out of Greece are going to dissipate a bit and with that the US earnings picture is going to start to emerge as the important factor," said Mike Binger, a portfolio manager at Gradient Investments in Shoreview, Minnesota, with $850 million under management.
Also making Wall Street more confident, Chinese stocks rose for a third straight day as data showed exports rose while imports slipped in June, a tentative sign global demand might be on the mend.
Historically high stock valuations may attract fresh attention when US companies post second-quarter results over the next several weeks. Wall Street expects a 2.9 per cent dip in quarterly earnings, according to Thomson Reuters I/B/E/S.
Pointing to expectations of calmer trading, the CBOE Volatility index fell 16 per cent on Monday. Its 29 per cent decline in the past two sessions is the largest two-day drop since January 2, 2013.
The Dow Jones industrial average rose 217.27 points, or 1.22 per cent, to end at 17,977.68. The S&P 500 gained 22.98 points, or 1.11 per cent, to 2,099.6 and the Nasdaq Composite added 73.82 points, or 1.48 per cent, to 5,071.51.
All of 10 major S&P 500 sectors were higher, led by the technology index, up 1.62 per cent. The financial index rose 1.09 per cent. Upcoming quarterly earnings reports from banks are expected to benefit from a recent rise in long-term yields relative to short term yields.
Crude tumbled on progress toward a nuclear deal that would end sanctions on Iran, allowing more oil onto the market. The energy index stayed positive but has been the worst-performing S&P sector over the last month, falling over 5 percent.
The oil slide boosted US airline stocks. American Airlines, United Continental, JetBlue and Alaska Air were all up between 1 and 3 per cent.
Apple was up 4.66 per cent in the past two days for its best back-to-back run since January.
Markwest Energy Partners rose 13.96 per cent. MPLX , Marathon Petroleum's master limited partnership, said it will buy the natural gas processor for about $15.63 billion. MPLX fell 14.51 while Marathon rose 7.88 per cent.
Advancing issues outnumbered decliners on the NYSE by 2,242 to 830. On the Nasdaq, 2,002 issues rose and 808 fell.
The S&P 500 posted 43 new 52-week highs and 10 new lows; the Nasdaq recorded 149 new highs and 42 new lows.
About 5.9 billion shares traded on all U.S. platforms, according to BATS exchange data, below the month-to-date average of 6.9 billion.