The S&P 500 and Nasdaq composite closed at record highs on Monday after a rise in tech and oil prices.
The S&P climbed about 0.5 percent, with materials leading advancers. Energy was also among the best performers after a sharp rise in crude prices.
West Texas Intermediate futures spiked 2.11 percent to settle at $48.85 per barrel after the Russian and Saudi energy ministers said the two countries agreed to extend a production cut until March 2018.
"This is a snap-back rally in crude. The rubber band had stretched too long below $55 per barrel; now we're around $50," said Joe Sowin, head of global equity trading at Highland Capital Management.
That said, an increase production from the U.S. could cap energy's gains, said Jason Pride, director of investment strategy at Glenmede. "Our Take: Oil should trade in the $50-70 range as increased demand is met by supply from U.S. share oil producers," Pride said in a note Monday.
The Nasdaq, meanwhile, was led higher by a rise in large-cap tech stocks, including Facebook and Alphabet. Shares of tech giant Apple also hit record highs.
The Dow Jones industrial average also closed higher as Cisco Systems' stock popped on the back of a massive cyberattack.