NEW YORK — You can almost hear Wall Street exhaling.

The Dow Jones industrial average soared more than 300 points Thursday after Republican leaders and President Obama finally seemed willing to end a 10-day budget standoff that has threatened to leave the U.S. unable to pay its bills.

The news helped the market notch its biggest gain since January and ended a three-week funk in stocks. It also injected some calm into the frazzled market for short-term government debt.

Republican leaders said Thursday they would vote to extend the government’s borrowing authority for six week. A spokesman for Obama said the president would “likely” sign a bill to increase the nation’s ability to borrow money.

“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 J.P. Morgan Asset Management. “Cooler heads are prevailing.”

The Dow jumped 323.09 points, or 2.2 percent, to close at 15,126.07. It was the index’s biggest point rise this year.

The Standard & Poor’s 500 index rose 36.16 points, or 2.2 percent, to 1,692.56 and the Nasdaq composite rose 82.97 points, or 2.3 percent, to 3,760.75.

Stocks have steadily declined since mid-September as Washington’s gridlock got investors worried that the U.S. 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.”

Thursday’s 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 Oct. 17. That would leave the U.S. 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 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,” 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 in small-company stocks means investors are more comfortable taking on risk. The Russell 2000 index jumped 26.04 points, or 2.5 percent, to 1,069.50.