A hard-line Republican revolt could not prevent legislation to raise the US debt ceiling from clearing its first procedural hurdle in the House of Representatives on Tuesday evening. Here's how the drama is playing out on Capitol Hill and a guide to what comes next.
The two parties finally reached a deal after a showdown lasting months, then weeks of painstaking negotiations.
Now the two leaders - Democratic President Joe Biden and Republican Speaker of the House Kevin McCarthy - must sell their weekend agreement to their members of Congress. They believe that even with some defections on the left and right, they have the votes to pass a bill before the deadline.
The Treasury has moved the day the US would hit its borrowing limit to Monday 5 June.
For the moment financial markets appear to have calmed as the prospect recedes of the global economic chaos that would result from the world's biggest economy defaulting on its $31.4 trillion (£25tn) debt.
That could quickly change, however, if the multi-step process for approving the debt-limit agreement is derailed or otherwise blocked in the days ahead.
The deal introduces new federal spending limits and restrictions on low-income aid programmes in exchange for a debt-limit increase.
It became clear on Tuesday that this is not a deal that satisfies conservative hard-liners in the House. The question is whether there are enough of them in the right spots to have their way. The answer, for the moment, looks like they do not.
At a press conference held on the steps of the US Capitol earlier on Tuesday, 11 members of the ultra-conservative House Freedom Caucus railed against what they viewed as insufficient spending cuts and budget limitations in the compromise legislation.
"This deal fails completely," said congressman Scott Perry, the leader of the group. He said those who stood with him "will be absolutely opposed to the deal and will do everything in our power to stop it".
They also dodged when asked whether they would call for Mr McCarthy's removal - a step that would escalate the rift forming among Republicans in the House.
"No matter what happens, there's going to be a reckoning for what just occurred unless we stop this bill by tomorrow," congressman Chip Roy of Texas, another Freedom Caucus member, warned.
The best chance for firebrand conservatives to smother the compromise bill in its infancy may have been on Tuesday evening, when the powerful House Rules Committee considered the terms by which the legislation would be debated and voted on by the full House.
With two Freedom Caucus members on the 13-seat committee, the hard-liners could have sided with Democrats and one more Republican to force Mr Biden and Mr McCarthy back to the drawing board with the debt clock ticking down.
Instead, the committee Republican who has most often sided with the Freedom Caucus, Thomas Massie, joined six other Republicans to send the 99-page bill to the floor of the House on Wednesday evening by a 7-6 vote.
Mr Roy and Ralph Norman of South Carolina joined the four Democrats in voting against.
"I don't like this process that led to this bill, I'm not going to lie," the Kentucky Republican said, before adding that there was enough in the deal to win his support.
Despite the victory for Mr McCarthy and backers of the deal, such a spilt among the majority party on the Rules Committee is exceedingly rare and underlines the frayed relations among House Republicans, who are currently the majority party in that chamber.
"The Republican conference right now has been torn asunder," Mr Roy said of his party on Tuesday afternoon.
With this first hurdle surmounted, these are the remaining steps necessary to end the debt-default crisis:
At the moment, rank-and-file members in both the House and Senate appear willing to fall in line.
There may be some defections from left-wing Democrats, who have complained about how the proposed budget cuts fall exclusively on social programmes and objected to the new work requirements on some recipients of low-income aid.
The Democratic hard-liners, however, have been less organised - and less vocal in their objections - than their conservative counterparts.