(Bloomberg) -- President Joe Biden said he and House Speaker Kevin McCarthy reached a final agreement to avert a historic US default after the two spoke again Sunday afternoon. 

“We’ve got good news. I’ve just spoken with Speaker McCarthy. We have a bipartisan budget agreement,” Biden said to reporters at the White House. 

He urged both chambers of Congress to pass the legislation. 

Both Biden and McCarthy now have to convince their allies to support the package, while tamping down frustrations on the left and right wings of their respective parties.

Despite reaching a deal, the clock is ticking. Treasury Secretary Janet Yellen warned Friday that the government’s borrowing limit must be extended by June 5 to avoid a payments default.

Biden complimented McCarthy for keeping his word in the talks but said “I have no idea if he has the votes.”

“I expect he does. I don’t think he would have made the agreement” otherwise, he added.

Biden, to the frustration of many congressional Democrats, has largely refrained from publicly selling the deal until the ink was dry. With the agreement now made, White House officials — briefing reporters Sunday night on condition of anonymity — touted provisions they said protected Biden’s priorities on climate and the social safety net.

One of the biggest losers is the Internal Revenue Service, which will get $20 billion cut out of the $80 billion Congress provided just last year to hire more agents and modernize systems. But White House officials said that money helped preserve some of Biden’s other domestic priorities, and they hope to front-load some of the remaining spending and seek more funding from Congress later. 

The bill would expand work requirements for the Supplemental Nutrition Assistance Program, which now requires able-bodied food stamp recipients aged 18 to 49 to work. That age range would be expanded to 54 — but White House officials said increased exemptions for veterans, homeless and foster families would mean the number of recipients would remain about the same. 

And on permitting, the White House agreed to reforms that would accelerate environmental review of many projects to just one or two years. Officials said those changes would help accelerate the transmission of energy from wind and solar projects. 

Biden this month cut short a planned trip from the G-7 leaders summit in Hiroshima, Japan, to Papua New Guinea and Sydney, Australia, to tend to the negotiations. The Pacific region is vital to US foreign policy to confront China’s growing influence.

The president brushed off assertions that debt ceiling talks that have gone essentially down to the wire — with the global economy at stake — weakened US standing among allies and adversaries.

“Just the nature of the way we handle the deficit and handle whether we’re going to, each year going to pay our debts, and it’s happened more than once, will probably happen again, but it’s not going to happen at least for another two years here,” Biden said. 

Biden said that he would explore in the future whether the US Constitution, which says that the validity of the debt “shall not be questioned,” would allow him to bypass the debt-limit law.

“It would cause more controversy getting rid of the debt limit. Although I do — I am exploring the idea that we would, at a later date, a year or two from now, decide whether or not the 14th Amendment, how that actually would impact on whether or not you need to increase the debt limit every year,” he said. “But that’s another day.”

(Updates with details from the agreement throughout)

©2023 Bloomberg L.P.