Joshua Roberts / Reuters

Updated on February 9 at 8:40 a.m. ET

There was no reason for Senate Majority Leader Mitch McConnell to feel nervous on Thursday morning. The day before, he and Senate Minority Leader Chuck Schumer had announced an agreement on a massive two-year budget deal to attach to a short-term funding bill. A few Senate Republicans were annoyed, to be sure—the deal busts through budget caps, allocating nearly $300 billion in defense and nondefense spending, along with $89 billion in disaster relief and a one-year suspension of the debt limit. But Schumer had corralled the support of more than enough Democrats. They’d easily reach 60 votes. And as South Dakota Senator John Thune told House members on the floor last evening, they’d likely have a vote ready by lunchtime.

Fast forward to early Thursday evening. Kentucky Senator Rand Paul took the floor, arguing that the United States must withdraw troops from Afghanistan. He then switched to a collection of colorful signs, one lambasting California’s allotment of funds for school lunches (“School Lunch Programs: Feeding Lawns, Not Kids”), and another calling the D.C. streetcar system, “A Streetcar Named Waste.” And just after 11 p.m., the Senate adjourned until 12:01 a.m. without voting on a spending bill, shutting down the government.

At 1:53 a.m., the Senate at last voted and passed the bill, 71 votes to 28. And after a tense standoff with House Democrats, at 5:30 a.m., Republican leadership claimed victory in the lower chamber, passing the deal and reopening the government, 240 votes to 186. Seventy-three Democrats broke from House Minority Leader Nancy Pelosi to vote in favor. President Trump signed the bill on Friday morning, ending the government shutdown.

In the end, both parties were forced to wrestle with their own respective fallouts: Democrats, on the directionless nature of their leadership, as yet another shutdown fight yielded no tangible victories. And Republicans, on whether their longtime message of fiscal prudence had become a permanent relic of the past.

The day’s tumult began when Paul, a libertarian who’s often been a thorn in the Republican leadership’s side, torpedoed the unanimous-consent vote needed to invoke cloture and speed up a final vote in the Senate. He was adamant that he would not endorse leadership’s plans to avert a shutdown by midnight unless the floor was open for him to introduce his amendment for a vote, which would set strict budget caps and slash the bill’s debt-ceiling measure. McConnell wouldn’t budge, arguing that opening the floor to Paul’s amendment would open the floodgates for others.

So at 6 p.m., McConnell called for a vote, and Paul objected—shutdown be damned.

For over an hour, Paul railed against Republicans for their hypocrisy on spending and deficits. The tea-party wave of support that swept large Republican majorities into office in 2010, he argued, premised on a conservative message of spending reforms and deficit slashing—a response, in many ways, to the big-spending years of the Bush era—had crashed. His colleagues grimaced and griped about Paul’s pageantry; Paul was, indeed, all but ensuring a government shutdown for little reason other than his desire to make a few points. Yet it’s likely that, were it a Democrat and not Donald Trump in the White House, Republicans would be cheering his words. As Alabama Representative Mo Brooks put it to reporters yesterday, “Quite frankly, I’m astonished that the Republican Party seems to be the party of big government in this day and age.”

Paul could only delay the proceedings until noon on Friday at the latest, although Senate leaders predicted—more accurately, hoped—it wouldn’t come to that. The Senate was able to vote near 2 a.m. on Friday morning, with the House following suit just a few hours later.

Yet the bill didn’t sail through the House as Republican leadership predicted. Sure, Deputy Whip Patrick McHenry and his team knew they’d have to rely on Democrats in the end, but they predicted around 70 would do the trick—not necessarily an impossible lift. As the seconds ticked by during the 15-minute vote, however, it was a clear a stand-off of sorts was taking shape: Democrats stood tall, their eyes locked on the voting board, refusing to budge with a vote either way until the clock ticked down to 0:00. The GOP whip team looked jittery. And then, with Pelosi looking sullen, the floodgates opened, and a total of 73 Democrats voted “yea” nearly in unison—despite the fact that, in the end, they’d won no concessions from Republicans, not even a promise from Ryan to hold an open vote on immigration legislation. As with the last shutdown, observers struggled to rationalize just what Democrats had gained.

It was fitting, in a way, that the U.S. government reopened with the same level of chaos that sparked its shutdown—all while most Americans were sleeping. Ultimately, the bill will be on the president’s desk by breakfast.

The tumultuous series of events Thursday reflects the governance-by-brinkmanship that has defined the 115th Congress. With multiple ideological factions of the Republican Party jockeying for control, government-funding bills have become a source of predictable tension—heightened by the closed-door, closed-amendment process by which they’ve often come together.

When the package was announced on Wednesday, the anticipated obstacle to its passage was House conservatives, members of the House Freedom Caucus (HFC) who decried its deficit-spiking cost. That pushed the House Republican leadership to turn its focus to Democrats, attempting to pick off enough votes to pass the bill and send it to the president’s desk. Yet by late Thursday, those efforts appeared temporarily moot, as Republicans in the upper chamber proved, yet again, their own worst enemies.

“Somehow [GOP] leadership will lie to themselves and say the last three weeks were worth it,” said a senior House GOP aide, referring to the short lapse of time since the last stopgap bill Republicans shoved through. (The aide spoke on the condition of anonymity because he was not authorized to speak to the press.) “Meanwhile, the majority is slipping away.”

As McConnell and Schumer cruised comfortably into the Capitol on Thursday, House leaders scrambled to solidify their whip count. Late Wednesday evening, HFC members voted to take an official stance against the bill—meaning that 80 percent of the group’s three-dozen-plus members were bound to vote against it.

Representative Mark Walker, chairman of the conservative Republican Study Committee, signaled to his members that he, too, would vote against the deal. “Republicans are being offered a false choice today: either support the military or maintain fiscal discipline,” Walker said in a statement today. “I am disappointed this deal creates friction among Republicans who believe in both.”

Which meant that House leadership was well aware they’d need Democratic votes to fill the void. Yet Thursday morning, the temperature of Minority Leader Nancy Pelosi’s caucus was anyone’s guess. Pelosi spoke for a record-breaking eight hours on the House floor Wednesday, a filibuster-style speech that excoriated Congress for its inaction on so-called “dreamers,” undocumented immigrants brought to the U.S. as children who were protected by the Obama-era Deferred Action for Childhood Arrivals program. Many Democratic aides, however, suggested that Pelosi’s speech was designed to placate progressives, an implicit admission that this bill would likely pass. Indeed, in a letter to colleagues Thursday morning, Pelosi reiterated her opposition to the bill, but did not instruct them to vote one way or the other. And in a last-minute, closed-door caucus meeting, she told Democrats to “vote their conscience” on the deal, according to a person with direct knowledge.

Ultimately, by early Thursday evening, Democratic and Republican aides alike predicted that some 70 Democrats would break from Pelosi and vote for the budget deal, ensuring its passage. And according to a Republican member of Congress with direct knowledge of the conversations, Secretary of Defense James Mattis had been working the phones, helping move “between 10 and 15” GOP defense hawks who had indicated they would vote no or were undecided to the “yes” column. To the relief of Republican whip team, the House was ready to vote.

Rand Paul had other plans.

Paul’s speech hit all the notes that the Republican congressional leadership frequently sounded during the Obama administration. If the last two days have shown anything, however, it’s that the party’s message has changed to something closer to what House deputy whip Patrick McHenry told me: Asked if the package was fiscally responsible, he said: “It’s fiscally necessary.”

All of which means that as Congress considers the aftershock of another shutdown, the second in Trump’s presidency, Republicans are grappling not just with the practical fallout—corralling members for a vote in the early hours, shipping the legislation to the House, hoping enough Democrats hold firm to ‘yes’ and that, before many folks awoke, the government would be up and running again. They’re also considering a more existential question: whether the central tenet of their messaging for the last eight years has, in fact, been a sham.

To answer this question, however, is to answer whether Donald Trump has irrevocably changed the Republican Party—and that’s not a question many members, for the moment, are all that interested in confronting.