(CNBC) — U.S. stocks rose on Monday after U.S. President Donald Trump and Chinese President Xi Jinping agreed to a 90-day cease-fire in the trade war that has weighed heavily on global stock markets for most of 2018.

The Dow Jones Industrial Average rose 287.97 points to 25,826.43 while the S&P 500 gained 1.1 percent to close at 2,790.37. The Nasdaq Composite rose 1.5 percent to end the day at 7,441.51. The consumer discretionary sector in the S&P 500 was the best performer, rising 2.5 percent. Amazon and Apple rose 4.9 percent and 3.5 percent, respectively.

Stocks came off their highs in midmorning trading, however. At its high of the day, the Dow had risen nearly 442 points.

Note: Read our discussion guidelines before commenting.