- The Dow, S&P 500 and Nasdaq composite rose to all-time highs.
- Members of the senate reached a short-term compromise to keep the government open through Feb. 8.
Stocks closed higher on Monday, erasing slight losses from earlier in the session, as U.S. lawmakers reached a deal that would resume government operations.
The rose 0.8 percent to close at a record of 2,832.97, with energy and telecommunications as the best-performing sectors. The Nasdaq composite also reached an all-time high, advancing 1 percent to 7,408.03, with shares of Netflix hitting a record. The Dow Jones industrial average gained 142.88 points to close at 26,214.60, an all-time high.
Stocks kicked off the session trading lower, but quickly erased those losses.
"The market has been through this enough times and understands Republicans and Democrats will come to an agreement," said Mark Heppenstall, CIO at Penn Mutual Asset Management.
Members of the senate reached a short-term compromise to keep the government open through Feb. 8. Democratic Sen. Mark Warner said the party has the assurance it needs on the budget and immigration issues.
On Saturday, the U.S. government shut down after a bill that would have kept government funded through mid-February was voted against in the Senate. The shutdown continued for a third day on Monday after the Senate on Sunday failed to reach an agreement to break an impasse before the work week began in Washington.
Historically, a brief bout of volatility has hit the market following a government shutdown. The Cboe Volatility Index, also known as the VIX and considered the best gauge of fear in the market trades positive 75 percent of the time one week after a shutdown and averaged a return of 9.7 percent, according to CNBC analysis using Kensho. The S&P 500 averages a return of negative 0.3 percent.
But these moves are often short-lived. The S&P 500 averaged a return of 2.1 percent a month after a shutdown and trades positive 80 percent of the time.
"Anyone with capital markets experience knows that US government shutdowns are largely meaningless in the context of financial asset values," said Nicholas Colas, co-founder of DataTrek Research, in a note. "Getting sucked into a series of seemingly ominous headlines that smarter players already understand is a typical rookie trading mistake."
Investors also paid attention to the corporate earnings season. On Monday, Halliburton reported better-than-expected earnings, sending the company's shares up 3.7 percent.
The calendar fourth-quarter earnings season is off to a good start. As of Friday, 68 percent of the S&P 500 companies that had reported surpassed earnings expectations, while 85 percent of those companies had beaten sales estimates, according to FactSet.
What's more, "last week, 27 companies in the S&P 500 reported 4Q 2017 results, not one of those companies had its next quarter (i.e. 1Q 2018) EPS estimates lowered after releasing results," said Nick Raich, CEO of The Earnings Scout, in a note.
"This is an amazing stat because in EVERY earnings season over the last seven years, a majority of S&P 500 companies have had their next quarter estimates lowered after reporting. So, the fact not one of the companies reporting last week had EPS estimates lowered is remarkable," Raich said.
Netflix and TD Ameritrade are scheduled to report quarterly earnings after the bell Monday.
Elsewhere in corporate news, Twitter shares fell 1.4 percent after CNBC reported that executive Anthony Noto has been offered the CEO job at Social Finance.
—CNBC's Christina Wilkie contributed to this report.