United States stocks closed sharply higher and Treasury yields fell as Senate leaders reached an agreement to reopen the government and put the US on course to avoid debt default.
The Dow Jones Industrial Average rose 205.82 points, or 1.36%, to close at 15,373.83 points.
The S&P 500 index closed up 23.48 points, or 1.38%, to 1,721.54 points.
The Nasdaq Composite Index advanced 45.42 points, or 1.20%, to close at 3,839.43 points.
Stocks jumped early on Wednesday in anticipation of a deal, then held gains after Senate leaders announced a compromise that would temporarily raise the nation's debt ceiling and fully reopen the government. The agreement was reached just a day before the US Treasury was expected to exhaust its ability to borrow more money. It must be approved by both the Senate and House to go into effect.
Uncertainty about the 16-day government closure's effect on the broader economy--and more importantly the potential for the US government to miss debt payments--sent stocks on big swings in recent weeks. Wednesday's advance erased the Dow's 133-point decline on Tuesday, and leaves the blue-chip index up 1.4% since before the shutdown began Oct. 1.
"Almost everyone assumed this would come together before the deadline," said Dan Greenhaus, chief global strategist at brokerage BTIG.
"To the extent that nervousness in the market falls to the sidelines, that's good for stocks."
Enthusiasm spilled into the Treasury market, where news of the deal pushed down yields on ultra-safe T-bill yields, as prices rose. The T-bill due Oct. 31 yielded 0.292%, down from an earlier session peak of 0.685%. The T-bill due Oct. 24 yielded 0.264%, down from a session peak of 0.722%.
Longer-dated Treasurys were boosted as well, as fears of a default diminished. The benchmark 10-year note's price rose 14/32, yielding 2.669%.
"The market is taking comfort in the idea that the government will be able to finance itself," said Dan Mulholland, head of US Treasury trading at BNY Mellon Capital Markets.
Investors cautioned that even if Congress approves the measure, US fiscal issues will be far from resolved, however. The Senate plan would fund federal agencies at current spending levels through Jan. 15 and extend the nation's borrowing authority through Feb. 7. Fitch Ratings late Tuesday to put the US sovereign credit rating under review for a downgrade, pointing to prolonged negotiations over the debt ceiling.
Investors said that the potential for fiscal issues to crop up again likely means that the Federal Reserve won't dial back its stimulus efforts before next year, for fear of disrupting the pace of economic growth. Fed stimulus, including its program to buy bonds in the open market, was key support driving stock benchmarks to all-time highs earlier this year.
"This ensures the Fed does not reduce asset purchases this year, and almost guarantees that we'll revisit this [budget-related] madness in a few months time," Mr Greenhaus said.
Bob Browne, chief investment officer at Northern Trust, said he'll be watching for signs of the shutdown's impact on the economy, as well as for whether future gridlock in Washington might take a bite out of economic growth.
"We never expected Congress to jump off the cliff, so it surprises us that the markets are congratulating themselves now that they didn't jump off the cliff," Mr Browne said. Additional market gains in coming weeks could be a chance to sell US stocks, he said.
Meanwhile, Intel climbed even as the semiconductor maker provided a downbeat sales outlook for the current quarter. The company also said it was a quarter behind in its plan to start volume production of the latest technology chips, but reported better-than-expected third-quarter earnings, revenue and gross margin.
Yahoo fell despite the Internet company's report of quarterly earnings that topped estimates, offsetting a current-quarter revenue outlook that was just shy of forecasts.
November crude-oil futures ticked up 1.1% to $102.29 a barrel, after falling to more than a three-month low on Tuesday. October gold futures rose 0.7% to settle at $1,282.00 a troy ounce. The dollar rose against euro and the yen.
In Europe, stocks touched five-year highs and the benchmark Stoxx 600 index rose 0.2%. Asian markets were mixed, as Japan's Nikkei Stock Average added 0.2%, and China's Shanghai Composite shed 1.8% as investors grew cautious ahead of economic growth data on Friday.