Speaker Kevin McCarthy speaks to the media at the US Capitol on April 26, 2023.
CNN  — 

Speaker Kevin McCarthy rolled the dice.

As he took his short walk from the speaker’s suite to the House floor on Wednesday evening, the California Republican wasn’t entirely sure he would have the votes on the most important bill of his young speakership: To raise the $31.4 trillion national debt limit on Republican support alone.

McCarthy knew he was close but couldn’t guarantee it, according to a person familiar with the matter.

After months of internal discussions, the speaker had been engaged in round-the-clock talks with pockets of dissident members, cutting deals and horse-trading to pick off one GOP vote after another in his high-stakes fight – all an attempt to show the White House and the country that his party speaks with one voice on the consequential economic battle.

But one Republican member was absent on Wednesday – and some hard-right members would not explicitly say how they’d vote, forcing the speaker to make a risky bet. In the end, it was two Democratic absences that helped McCarthy: Allowing him to pass the bill on the narrowest of margins, 217-215, and now shifting the focus to the White House and Senate Democrats.

“We are the only ones to lift the debt limit to make sure this economy is not in jeopardy,” McCarthy beamed in the Capitol’s ornate Statuary Hall moments after the gavel came down, calling on President Joe Biden to negotiate a spending-cut deal he has resisted for months. He added: “You’ve underestimated us.”

It was an effort that was months in the making. Immediately after securing the speakership in a messy, 15-ballot race, McCarthy made the concerted decision to avoid the pitfalls of a predecessor, John Boehner, and allow rank-and-file members to feel like they could shape the ultimate package rather than being steamrolled by leadership. A dozen listening sessions were held by two members of his whip team, Reps. Tom Emmer of Minnesota and Guy Reschenthaler of Pennsylvania, starting in February and continuing with them calling every member through this past weekend. Then there were regular meetings of the so-called “five families” – nicknamed after the mob families in “The Godfather” – that represent various ideological factions of the conference and were led by Rep. Garret Graves of Louisiana.

But even after they had agreed to an outline of their deal last week, McCarthy continued to run into pitfalls. In a meeting last week in the basement of the Capitol, he and his team moved to appease conservatives who wanted to target tax breaks for biofuels in the Democrats’ Inflation Reduction Act. McCarthy agreed, prompting a furious pushback by Iowa Republicans, including a tense phone call between Gov. Kim Reynolds and McCarthy.

It was an issue that could have derailed the bill and one that put McCarthy in familiar crosshairs between competing factions of his conference. But he ultimately cut a deal past 2 a.m. on Wednesday and helped move closer to securing the votes more than 15 hours later.

“They realized that you were not going to be able to steamroll four people from Iowa,” said Rep. Zach Nunn, an Iowa freshman, referring to the four GOP members of the delegation.

Yet more problems emerged, and McCarthy moved to head them off. Rep. Nancy Mace told reporters Wednesday morning she was ready to vote against the plan over her concerns it didn’t go far enough to balance the budget. But after an afternoon meeting in his office, the South Carolina Republican said she would back the plan. The promise, according to a source familiar with the matter: Votes on bills dealing with women’s access to reproductive health care and a vote on a bill dealing with active shooter alerts.

“I haven’t gotten rolled yet by the leadership on anything,” Mace said, defending her deal-cutting.

The ultimate plan would raise the debt limit by $1.5 trillion and propose to implement a slew of spending cuts to domestic programs, in addition to new work requirements on Medicaid beneficiaries and provisions targeting Biden’s domestic and regulatory agenda. It would save $4.8 trillion over the next 10 years, according to the Congressional Budget Office. But the $1.5 trillion increase would only last through March 2024 at the latest.

In a private meeting in the Capitol, GOP leaders debated how high of a debt limit increase they should seek. Some had floated odd numbers because it sounded more intentional than an even number. One member suggested $1.69 trillion, but that was rejected because of the innuendos associated with such a figure, according to three GOP sources. Ultimately, a $1. 5 trillion increase was the number they settled on.

Republicans say the deal-cutting that has since transpired was the result of new relationships forged from McCarthy’s drawn-out fight for the speaker’s gavel in January.

“Absolutely, it has reaped benefits to everyone in the conference,” Rep. French Hill, a Republican of Arkansas, said of the relationships that were formed.

‘This is going to bite us’: An Iowa blowup

But passing the bill was never a sure bet – something McCarthy sensed last week as he moved to appease conservatives and push for a repeal of energy tax breaks.

“This is going to come back to bite us,” McCarthy warned conservatives last week, according to a person in the room, as they demanded the bill repeal green energy tax credits and other provisions in the Inflation Reduction Act. McCarthy feared taking that step would unlock a process allowing the Senate to later jam the House on thorny tax-related provisions.

But he had a more immediate problem: The governor of Iowa.

A fired-up Reynolds, the two-term Republican governor, was on the phone with McCarthy on Tuesday, relaying concerns over the provision in his debt ceiling plan to repeal tax breaks for ethanol use, according to people familiar with the call, warning it would be detrimental to farmers in her state.

All four GOP members of the Iowa delegation, who were also in constant communication with the governor, informed leadership in a Tuesday night meeting that clawing back the tax credits was a “red line” for them, according to sources in the room.

McCarthy now had a math problem. His allies had believed that the Iowa Republicans, some of the closest allies of leadership, would swallow the provisions and ultimately side with their party in their high-stakes fight with the White House. But they had miscalculated, forcing the speaker to cut a last-ditch deal after repeatedly insisting they would not open the bill to changes.

Nunn, the Iowa Republican, told CNN he learned about the deal at around 2:30 a.m. on Wednesday, when Graves came to his office along with Rep. Michelle Fischbach, a Minnesota Republican who had similar issues with the ethanol provisions.

“We had been in conversation throughout the entire day, but by Tuesday, we had really ratcheted up,” Nunn told CNN. “Iowa nice also means Iowa stubborn.”

It was an issue that GOP leaders had sought to avoid. They had worried that if they cut a deal with the Iowa delegation, they would have to make similar deals with members from fossil-fuel heavy districts in order to make them happy.

And the leadership knew if they were going to make 11th-hour changes to appease Midwestern Republicans, they’d have to offer some concessions to conservatives as well, and ultimately agreed to a faster implementation of the Medicaid work requirements. Yet even that wasn’t enough to satisfy some conservatives who had been pushing for that change – namely GOP Rep. Matt Gaetz of Florida, who was upset that the deal was cut at the last minute after the leaders said they wouldn’t change the bill, according to people familiar with the matter. He was one of four who later voted against the plan.

Rep. Ken Buck, a member of the whip team, said in the end, he voted “no” because the GOP bill didn’t do enough to reduce the deficit. The Colorado Republican told CNN, “$58 trillion with Biden’s numbers and $53 trillion, it’s just too much debt.”

But one member that McCarthy had been lobbying came through: freshman Rep. Eli Crane. The Arizona Republican had been wavering on the bill and was being heavily whipped by leadership, but said he ultimately backed the legislation because of his constituents.

“We conducted a poll at a teletown hall last night and the people that responded overwhelmingly supported this bill,” he told CNN. “It kind of surprised me, honestly.”

With this victory secured, McCarthy could later have an even bigger test on his hands: If he is forced to ask his conference to get behind any deal with Biden to raise the debt limit – something that almost certainly wouldn’t go as far as the House plan for spending cuts.

His members are watching him closely.

“What Kevin has assured us is he’s not coming back and presenting a watered-down version,” said Rep. Ralph Norman of South Carolina, a member of the House Freedom Caucus.

Annie Grayer, Alayna Treene, Haley Talbot and Morgan Rimmer contributed to this report.