Senate Democrats and Republicans neared a deal on Thursday that would temporarily stave off a default on the government’s debts, exploring a short-term reprieve to a high-stakes battle that had threatened to plunge the United States into a new economic recession.

The potential agreement between the two parties’ lawmakers, which was not final, arrived less than two weeks before the country is set to careen into a financial crisis. Without congressional action, the government could face new limits on its ability to pay its bills, a development that could have direct consequences on Americans’ wallets — and rattle stock markets around the world.

To prevent such a crisis, Senate Majority Leader Charles E. Schumer (D-N.Y.) and Minority Leader Mitch McConnell (R-Ky.) inched closer to a pact that would raise the borrowing limit until an unspecified date in December. McConnell put forward the idea midday Wednesday, loosening a weeks-long logjam during which the GOP twice had banded together against Democratic attempts to suspend the debt ceiling into 2022.

Negotiations stretched into Thursday morning on the final details of their truce, including the exact amount by which they would raise the cap. Taking to the Senate floor shortly after midnight, Schumer sounded an upbeat note: “We’re making good progress, we’re not there yet, but I hope we can come to agreement tomorrow morning,” he said.

The deal promised to put an end to the recent, public sniping between the Democratic leader and his chief Republican foe. But it also threatened to be short lived, potentially returning the nation’s capital to the fiscal precipice once their short-term solution runs out in perhaps six weeks. The prospect of a new looming deadline risked reigniting the same political and procedural headaches that had brought the Senate less than two weeks from a default in the first place.

“Our Republican colleagues were telling us time and time again they were not going to do anything to help us deal with this debt ceiling crisis,” said Sen. Bernie Sanders (I-Vt.). “They have finally done the right thing.”

The frenetic late push toward a debt ceiling deal marked the latest development in an ongoing controversy over the government’s borrowing ability — and who, exactly, should be responsible for addressing it. The cap must be raised periodically because Washington spends much more money than it brings in through revenue, forcing the Treasury Department to borrow funds to cover the difference.

Under President Biden, however, the debt ceiling also has become a proxy war over the two parties’ competing agendas. McConnell has aimed to pin the burden on Democrats, alleging that it is connected to their huge spending agenda, which Republicans flatly oppose. Democrats have countered that the debt ceiling reflects past spending, including large amounts borrowed during the Trump administration. And the party has pointed out that the solution should be bipartisan, since they had joined with the GOP in raising the threshold even during the last administration.

During the Trump administration, Democrats called for more spending before agreeing to raise the debt limit. Now, they are calling for a clean increase. (JM Rieger/The Washington Post)

The standoff for days has threatened to catapult the country into a financial crisis, unless lawmakers act by Oct. 18. At that point, the government would be at risk for defaulting on its obligations, a calamity that could delay seniors’ Social Security checks, prevent some families from receiving monthly child tax assistance and raise the cost of borrowing for millions of Americans by driving up interest rates.

The Treasury Department this week said such an outcome could also undermine government bonds, and the Defense Department added Wednesday that it presented new harm to “our service members and their families,” jeopardizing the government’s ability to pay service members and civilians on time while providing benefits to veterans. Biden has likened it to a “meteor” crashing into an economy still reeling from the consequences of the coronavirus pandemic.

Staring down an imminent deadline, Senate Democrats led by Schumer have tried for weeks to suspend the debt ceiling into 2022, bringing a series of measures to the floor that might have averted the crisis. For these measures to advance, Democrats needed 10 Republican votes, because the Democrats’ tiebreaking majority alone is insufficient in a chamber where most work requires the support of 60 to proceed.

“Democrats have been clear from the start. We are going to do the responsible thing and vote to allow the U.S. to keep paying its bills,” Schumer said on the Senate floor earlier Wednesday.

Each time, however, Republicans led by McConnell banded together to block them, inching the country one day closer to default. GOP lawmakers had promised since the summer to withhold their votes on any measure to raise the debt ceiling as part of their broader opposition to Biden’s economic agenda. That includes a still-evolving, up to $3.5 trillion measure that would expand Medicare, invest new sums to combat climate change and expand a host of federal education, immigration and safety net programs.

“They basically want us to be aiders and abettors to their reckless spending and tax policies, and we just aren’t going to do it,” Sen. John Cornyn (R-Tex.) said this week.

GOP lawmakers have described the entirety of that spending package — named after Biden’s 2020 campaign pledge to “build back better” — as an attempt to codify socialism into law. And they have insisted it is likely to add to the federal debt, despite Democratic assurances to the contrary, contributing to the GOP’s growing resistance toward voting to raise the country’s borrowing cap.

“They want to spend the money. They’ve got to provide the votes to get the debt limit increased so they can accommodate that,” Sen. Charles E. Grassley (R-Iowa) said this week.

Instead, McConnell for months insisted that Democrats had to address the matter through a Senate process known as reconciliation. The legislative maneuver, which is reserved for budgetary measures, allows Democrats in charge to advance legislation using 51 votes. Schumer, however, for weeks rejected McConnell’s demands to invoke reconciliation, arguing that it would have been “risky,” potentially taking so long that Democrats risked breaching the debt ceiling deadline anyway.

By Wednesday morning, both leaders continued to stand their ground — with Schumer setting the Senate on track for a third vote on the debt ceiling that McConnell planned to scuttle. Taking to the chamber floor, the GOP leader faulted Democrats for having “squandered week after week after week” in bringing ill-fated bills to a vote. But McConnell hours later emerged from a meeting with his party’s top lawmakers, offering unexpectedly to lessen the blockade — even if only temporarily.

“To protect the American people from a near-term Democrat-created crisis, we will also allow Democrats to use normal procedures to pass an emergency debt limit extension at a fixed dollar amount to cover current spending levels into December,” McConnell said in a statement. “This will moot Democrats’ excuses about the time crunch they created and give the unified Democratic government more than enough time to pass stand-alone debt limit legislation through reconciliation.”

McConnell’s deal prompted Democrats to hold their own private, hastily scheduled meeting. They emerged more than an hour later, emboldened that the GOP leader had, in their minds, bent to their demands: Sen. Elizabeth Warren (D-Mass.), for one, said that McConnell had “caved” in a move that opened the door for Democrats to address the crisis and pursue their broader agenda.

“And now we’re going to spend our time doing child care, health care and fighting climate change,” she said.

But Democrats also insisted that they still did not plan to use reconciliation to adopt another debt ceiling increase if the Senate does push the deadline into December. Privately, Democrats for weeks have understood the political motivation in McConnell’s demands, which essentially threaten to force them to raise the debt ceiling by a specific amount — rather than suspend it outright — opening the door for new attacks entering the 2022 midterms campaign.

In refusing to accede, Democrats threatened to revive the exact fight two months from now — at the same time that Congress must address another critical deadline to fund the government’s operations and prevent a shutdown at the end of the year. Still, party lawmakers signaled a willingness to take the deal and save the fight for the days ahead.

“I’m certainly willing to save the country from disaster from the next [few] months,” said Sen. Chris Murphy (D-Conn.), later acknowledging: “We’ll be back in the same position.”