WASHINGTON — Senate leaders neared the completion Monday night of a bipartisan deal to raise the debt ceiling and end the government shutdown while the rest of the world braced for the possibility of a U.S. default that could set off a global financial disaster.

Negotiators talked into the evening as senators from both parties coalesced around a plan that would lift the debt limit through Feb. 7, pass a resolution to finance the government through Jan. 15 and conclude formal discussions on a long-term tax and spending plan no later than Dec. 13, according to one Senate aide briefed on the plan.

But while both Sen. Mitch McConnell of Kentucky, the Republican leader, and Sen. Harry Reid of Nevada, the Democratic leader, praised the progress that was made in the Senate, it was already clear that the most conservative members of the House were not going to go along quietly with a plan that does not accomplish their goal from the outset of this two-week crisis: dismantling the president’s health care law.

“We’ve got a name for it in the House: It’s called the Senate surrender caucus,” said Rep. Tim Huelskamp, R-Kan. “Anybody who would vote for that in the House as Republican would virtually guarantee a primary challenger.”

There have been other showdowns between Republican lawmakers and President Barack Obama that went to the last minute: In 2011, lawmakers reached a deal to raise the nation’s debt ceiling two days before officials said a default was possible, resulting in a stock market plunge and the downgrading of the nation’s credit rating.

But the real possibility that as of Thursday the government would not be able to meet its obligations prompted grim warnings of an economic catastrophe that could ripple through stock markets, foreign capitals, corporate boardrooms, state budget offices and the bank accounts of everyday investors.

“If Republicans aren’t willing to set aside their partisan concerns in order to do what’s right for the country, we stand a good chance of defaulting, and defaulting could have a potentially devastating effect on the economy,” Obama told reporters at Martha’s Table, a Washington-area food bank.

Officials in several states said a default would mean unprecedented but unknown consequences to federal programs that are administered by the states, like Medicaid and food stamp programs. They also said that a market collapse could undermine state pension plans. And higher interest rates from a default on federal bonds could make short-term borrowing more difficult and costly for states.

“This has us pretty nervous; it’s just a mess,” said John E. Nixon, the budget director for the state of Michigan. “We are taking it very seriously, and we have our agencies preparing contingency plans. But obviously nobody really knows how it’s going to unfold, so you can only plan so much.”

Scott D. Pattison, the executive director of the National Association of State Budget Officers, spent Monday morning fielding calls from anxious members across the country.

“A lot of these folks are looking into ‘What kinds of options do we have if there is a cash crunch?’” Pattison said. “They are very, very nervous. It’s uncharted territory.”