Stocks hit record highs on Monday and notched their fourth straight gain as a so-called phase one trade deal between China and the U.S. clears the path higher for Wall Street to end a banner year.

The Dow Jones Industrial Average closed 100.51 points higher, or 0.4% at 28,235.89. The S&P 500 gained 0.7% to end the day at 3,191.45 while the Nasdaq Composite jumped 0.9% to 8,814.23.

"This has been the thing that, personally, I've been looking for all year," said Kim Forrest, founder of Bokeh Capital, referring to the trade agreement. "Increased trade is going to allow companies to start spending again on capital expenditures. That had been frozen, and most of most of those are technology purchases."

Tech shares rose 0.9% and hit a record, led by a 3.4% gain in Micron Technology and a 4.1% jump in Western Digital. Goldman Sachs helped the Dow reach an all-time high, rising 1.4%.

Sentiment was also lifted by strong economic data out of China. Chinese industrial production rose 6.2% in November on a year-over-year basis, topping expectations. Retail sales in China also jumped 8% last month.

The U.S. and China announced Friday they will move forward with a so-called phase one trade deal. As part of the agreement, the U.S. will roll back some levies on Chinese products and China will increase its purchases of U.S. agricultural products. Treasury Secretary Steven Mnuchin said will be inked in January.

"This should put to rest for the time being the 'trade war' volatility factor in markets, which has become a dominant theme over the past year and a half," said Eleanor Olcott, China policy analyst at TS Lombard, in a note. "This brief interlude of calm for the China-US relationship presents some investment opportunities."

Stocks posted solid gains last week in anticipation of the agreement. News of the deal comes after a record-setting rally from mid-October throughout November. It is also the latest market headwind that is at least temporarily resolved.