Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Stocks rose on Tuesday amid news that lawmakers had secured a tentative deal on border security funding.

The Dow Jones Industrial Average rose 250 points, led by Goldman Sachs and J.P. Morgan Chase. The S&P 500 climbed 0.9 percent as energy and financials outperformed. The Nasdaq Composite also advanced 1 percent.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"It appears as though the government shutdown was avoided. That's good news for the market," said Art Hogan, chief market strategist at National Securities.

On Monday night, congressional negotiators struck a deal in principle that would keep the government open and avoid a shutdown on Friday.

Investors also focused on U.S.-China trade talks as both countries try to hammer out a deal before an early March deadline. Both sides expressed hopes the new round of negotiations, which began in Beijing on Monday, would bring them closer to a comprehensive trade agreement.

Bloomberg News also reported that some U.S. aides acknowledge the most likely scenario at this point is the deadline will be moved given how far behind both sides are on trade talks. The trade dispute has already started to impact global growth, with investors worried a protracted dispute could soon severely hurt corporate earnings.

Shares of Deere, Boeing and Caterpillar all rose Tuesday. These stocks are seen as global-trade bellwethers for their exposure to overseas markets.

"If the U.S. and China come to a meaningful trade agreement soon, investors will start to discount its positive impact with more scrutiny on geographic/sector/asset class exposures and correlations will decline," wrote Nicholas Colas, co-founder of DataTrek Research.

"If that trade agreement is wishy-washy or fails to materialize, then investors will assume a global recession is inevitable," he said.