The Dow Jones industrial average has soared more than 300 points after Republican leaders and US president Barack Obama finally seemed willing to end a 10-day budget standoff that has threatened to leave the US unable to pay its bills.
The news drove the Dow to its biggest points rise this year and injected some calm into the frazzled market for short-term government debt.
Republican leaders said they would vote to extend the government's borrowing authority for six weeks. A spokesman for Mr Obama said the president was "likely" to sign a bill to increase the nation's ability to borrow money so it can continue paying its bills.
"Congressmen and women are coming to terms with how calamitous it would be if the debt ceiling was not raised," said Joseph Tanious, Global Market Strategist for JP Morgan Asset Management. "Cooler heads are prevailing."
The Dow jumped 323.09 points, or 2.2%, to close at 15,126.07.
Stocks have steadily declined since mid-September as Washington's gridlock got investors worried that the US could default on its debt and wreak havoc on global financial markets. While traders applauded the deal between the White House and Congress, more volatility could be ahead if a deal falls through.
"We don't need some grand bargain, we just need to avoid a default," said Brian Reynolds, chief market strategist at Rosenblatt Securities. "Just don't bring us to the edge again."
The Standard & Poor's 500 index rose 36.16 points, or 2.2%, to 1,692.56 and the Nasdaq composite rose 82.97 points, or 2.3%, to 3,760.75.
The gains were extraordinarily broad. Of the 500 stocks in the S&P 500 index, only 11 fell. Banks and industrial stocks rose the most.
A potential compromise between the two political parties could not come soon enough. Treasury secretary Jack Lew has said the government will hit its borrowing limit on October 17. That would leave the US with enough cash to last just a week or two before a default became a real risk.
A short-term extension of the debt limit is "the right approach", said Jack Ablin, who manages 66 billion dollars as chief investment officer at BMO Private Bank.
"It allows politicians to turn down the heat a bit while still keeping the broader issues on the front burner," Mr Ablin said.
In another bullish signal, small company stocks rose even more than the rest of the market. Those stocks tend to be riskier than large, well-established companies but can also offer investors greater rewards. A sharp increase means investors are more comfortable taking on risk. The Russell 2000 index jumped 26.04 points, or 2.5%, to 1,069.50.
There were hopeful signs in the market for short-term US government debt. The yield on the one-month Treasury bill eased to 0.25% from 0.27% late on Wednesday.
The yield had spiked from near zero at the beginning of the month to as high as 0.35% onTuesday as investors dumped the bills out of concern that the government might not be able to pay them back when they are due. Investors demand higher yields when they perceive debt as being risky.
One major investor made a move to cut its exposure to short-term US government debt. Fidelity Investments, the nation's largest money market fund manager, said had sold all of its short-term US government debt.