"The market has been buffeted with a lot of headwinds lately, and the biggest one is trade," said Art Hogan, chief market strategist at B. Riley FBR. "If you were to take trade out of the picture, you would have a smoother ride higher in this market."

The Dow Jones Industrial Average rose 259.29 points to 26,049.64 as Caterpillar outperformed. Monday also marked the first time since Feb. 1 that the Dow closed above 26,000.

The S&P 500 gained 0.8 percent to close at 2,896.74 — a record high — with materials and financials as the best-performing sectors. The Nasdaq Composite climbed 0.9 percent to an all-time high, breaking above 8,000 points for the first time, as Facebook, Amazon, Netflix and Alphabet rose. Tech's gains led the Nasdaq to close at 8,017.90.

Stocks jumped on Monday as the United States and Mexico closed a new trade deal, potentially removing a source of uncertainty that had been plaguing investors for months.

President Donald Trump said the deal would be called The United States-Mexico Trade agreement, leaving behind the 24-year-old NAFTA name. "The name NAFTA has a bad connotation because the United States was hurt very badly by NAFTA," he said. Trump added that the deal with Mexico is also very helpful for farmers and manufacturers. U.S. Trade Representative Robert Lighthizer said the deal must be approved by Congress before being implemented.

The comment comes after Mexican Economy Minister Ildefonso Guajardo said Sunday both countries were close to resolving key differences on trade. This would pave the way for a new deal between the two longtime trade partners. "We've continued making progress," Guajardo said.

Trump tweeted earlier on Monday that a deal with Mexico was "looking good."

Tweet

Shares of Caterpillar and Boeing rose 2.8 percent and 1.3 percent, respectively. Their stocks are considered trade bellwethers because of their large exposure to overseas markets. Shares of Ford, General Motors and Fiat Chrysler also rose.

The Mexican peso rose 0.7 percent against the dollar.

Dan McMahon, director of equity trading at Raymond James, said the positive trade news "allows for more room to run" in the market, but noted that equities are also benefiting from a typically slow time in the year. "There's nothing [else] going on today," he said.

Investors have been grappling with trade worries over the past few months as the U.S. takes a more protectionist stance toward its economy and trade deals under the Trump administration. The U.S. has slapped tariffs on billions of dollars worth in Mexican and Chinese imports, to which Mexico and China have retaliated.

Bank shares surged, led by gains in Goldman Sachs, Morgan Stanley, Citigroup and J.P. Morgan Chase. Goldman rose 3.4 percent while Morgan Stanley jumped 3.7 percent. Citigroup advanced 2.4 percent and J.P. Morgan climbed 1.8 percent. The SPDR S&P Bank exchange-traded fund (KBE) rose 0.2 percent.

Global markets were also buoyed by comments from Federal Reserve Chair Jerome Powell. He said he sees "further, gradual" rate hikes ahead. The Fed chief said at the Jackson Hole Symposium in Wyoming that the central bank would likely continue with its policy tightening if the economy continued to strengthen.

Powell's comments lifted the S&P 500 and Nasdaq composite indexes to record highs in Friday's trading session. In Europe, the Stoxx 600 index rose 0.5 percent on Monday, while the German Dax climbed 1.2 percent.

In Asia, China's central bank, the People's Bank of China (PBOC), reintroduced a policy adjustment aimed at supporting the yuan. The move, coupled with Powell's comments, sent the Shanghai Composite up by 1.9 percent overnight.

Tesla shares dropped 1.1 percent after CEO Elon Musk gave up efforts to take the company private.