(Bloomberg) -- President Joe Biden signed legislation averting a US debt default, sidestepping a catastrophic blow to the economy with a bipartisan victory that defied Washington expectations. 

The measure brokered with House Speaker Kevin McCarthy limits federal spending for two years and suspends the debt ceiling through the 2024 election. It cleared the House and Senate by wide margins, cementing Biden’s reputation as a pragmatic dealmaker as he prepares to intensify his reelection run. 

Biden signed the bill behind closed doors without a ceremony. A White House statement Saturday announcing the signing thanked congressional leaders, including McCarthy and Senate Republican leader Mitch McConnell, “for their partnership.”

The president touted the accord Friday evening in his first Oval Office address as a prime example of his ability to work across the aisle, even with the nation deeply divided.

“The only way American democracy can function is through compromise and consensus, and that’s what I worked to do as your president,” he said, adding that in times when “the American economy and the world economy is at risk of collapsing, there is no other way.”

The Senate passed the legislation late Thursday, a day after the House approved it. Lawmakers faced a Monday deadline to avoid triggering a first-ever US payments default.

The possibility of a recession caused by a default posed one of the biggest threats to Biden’s chances of winning a second term. The 80-year-old president, who has faced questions about his age and fitness for office, neutralized it by negotiating a bipartisan agreement that passed through a bitterly divided Congress.

Market Relief

Yields on Treasury bills maturing in early June — when Treasury Secretary Janet Yellen has said her department risks running out of cash — tumbled Friday with rates on some issues dropping below 5%. The cost of insuring US sovereign debt against default via derivatives has tumbled.

At one point this month, it exceeded levels on the bonds of many emerging markets with credit ratings well below that of the world’s biggest economy

The debt-limit and budget bill was the product of weeks of negotiations between Biden, McCarthy and their deputies. The president personally appealed to lawmakers to vote for the deal, and large majorities of Democrats in the House and Senate supported it.

Still, the final product left dozens of lawmakers on the left opposing the agreement due to the inclusion of new work requirements for people on federal benefits, easing of energy-project permitting and spending curbs. Other members who voted for it did so reluctantly. That dynamic could pose a challenge for a president with low approval ratings and a less-than-enthusiastic base.   

McCarthy perhaps faced even more political peril than Biden, negotiating with the threat that far-right Republicans who tried to block his speakership in January could try to unseat him if they did not like the deal’s terms. 

Seventy-one House Republicans ended up voting against the measure arguing it fell short of their demands for spending cuts. But 149 supported it, and McCarthy avoided an imminent vote to terminate his speakership. 

The debt-limit bill would suspend the debt ceiling until Jan. 1, 2025 in exchange for caps on federal spending on defense and domestic programs into 2025. That could force government programs to recede, should inflation remain at 5%.

Both Biden and McCarthy claimed victory with the agreement. 

Read more: Biden Uses Debt-Ceiling Deal as Launch Pad for 2024 Reelection

The president faced ridicule from some in his party during the 2020 campaign when he predicted Republicans would have an “epiphany” and begin working with Democrats again in the post-Donald Trump era. 

While the country has remained historically polarized, the debt-limit deal is the latest in a line of bipartisan deals — including an infrastructure law and subsidies for domestic chip manufacturing — that Biden could use to argue he was right. 

The White House has argued House Republicans would have won spending curbs in any budget agreement and the debt-limit deal also left untouched Biden’s legislative achievements. 

For McCarthy, the bill showed he could marshal the support of his unruly conference behind a bipartisan agreement amid doubts sparked by his messy election to the speakership earlier this year, which required 15 ballots. The deal garnered the support of roughly two-thirds of House Republicans, though Democratic votes were needed to pass it. 

The California Republican also forced a reluctant Biden to negotiate over raising the debt ceiling, something the president said he would not do.

It also marked a turning point toward lowering government spending after a series of record-setting Covid emergency measures and Biden’s landmark tax, health and climate law and infrastructure package. 

Spending limits could have a major effect on certain people, including young college graduates who must resume student-loan payments and low-income Americans on food assistance who face new restrictions on their benefits or service cuts. Morgan Stanley economists estimate the overall package will have a “negligible impact” on the US economy, however, likely lowering growth next year by a couple tenths of a percentage point.

--With assistance from Erik Wasson, Billy House, Steven T. Dennis and Josh Wingrove.

(Updates with closed-door signing in third paragraph.)

©2023 Bloomberg L.P.