Newly elected Speaker of the House Kevin McCarthy, R-Calif., gave special thanks to former President Donald Trump for his role in the negotiations that won over several Republican holdouts and led to McCarthy winning support from his conference to be elected speaker.

"I do want to especially thank President Trump," McCarthy told reporters early Saturday morning. "I don't think anybody should doubt his influence. He was with me from the beginning … he was all in."

Concluding four days of high drama, the House of Representatives elected McCarthy as speaker on the 15th ballot, after he made several concessions to a group of 20 hardline Republicans who had withheld their support from him on the first 14 votes. The holdouts had demanded rules changes that would decentralize power in the House, greater representation on the powerful Rules Committee, and commitments to cap spending and launch investigations into alleged abuses of power by the FBI and other Biden administration agencies. 

In the end, McCarthy won 216 votes, which was enough to win the election after six remaining holdouts voted "present" and lowered the threshold. They were Reps. Andy Biggs of Arizona, Lauren Boebert of Colorado, Elijah Crane of Arizona, Matt Gaetz of Florida, Bob Good of Virginia and Matt Rosendale of Montana. 

KEVIN MCCARTHY ELECTED HOUSE SPEAKER IN 15TH FLOOR VOTE AFTER DAYS OF HIGH DRAMA

House Speaker Kevin McCarthy

House Speaker Kevin McCarthy, R-Calif., celebrates after taking the oath of office in Washington, D.C., on Jan. 7, 2022. (Nathan Posner/Anadolu Agency via Getty Images)

The speaker credited Trump with calling members of Congress Friday night to secure the final votes he needed.

"He would call me, and he would call others. He really was – I was just talking to him tonight – helping get those final votes," McCarthy said. "What he's really saying, really, for the party and the country, that we have to come together. We have to focus on the economy. We've got to focus, make our borders secure. We gotta do so much work to do, and he was a great influence to make that all happen. So, thank you President Trump." 

‘OH, FOR CHRIST’S SAKE': CNN HOT MIC CATCHES AUDIBLE GROAN DURING KEVIN MCCARTHY REMARKS

FILE - House Minority Leader Kevin McCarthy and U.S. President Donald Trump attend a legislation signing rally with local farmers on February 19, 2020, in Bakersfield, California. (David McNew/Getty Images)

Trump responded Saturday morning on Truth Social, writing, "Thank you, Kevin. It was my great honor!"

Earlier this week, Trump threw his support behind McCarthy, urging House Republicans to unite and move forward to challenge the Biden administration. The 20 Republican holdouts initially ignored the former president, continuing to oppose McCarthy while an agreement was under intense negotiations behind the scenes.  

KEVIN MCCARTHY DELIVERS FIRST REMARKS AFTER WINNING HOUSE SPEAKER: ‘OUR NATION IS WORTH FIGHTING FOR’

Representative Marjorie Taylor Greene, a Republican from Georgia, holds her smart phone with former US President Donald Trump on the line, as Representative Matt Rosendale, a Republican from Montana, waves it off

Rep. Marjorie Taylor Greene, a Republican from Georgia, holds her phone with former President Donald Trump on the line, as Rep. Matt Rosendale, a Republican from Montana, waves it off during a meeting of the 118th Congress in the House Chamber at the U.S. Capitol in Washington, D.C., Friday, Jan. 6, 2023. (Al Drago/Bloomberg via Getty Images)

But Trump remained in contact with GOP lawmakers on both sides of the divide, right up until the end. Rep. Marjorie Taylor Greene, R-Ga., a McCarthy ally who is close with the former president, was pictured offering an iPhone with Trump on the line to Rep. Matt Rosendale, R-Mont., on the House floor Friday night. Rosendale ultimately voted "present," pushing McCarthy over the finish line on the 15th round. 

Trump celebrated the results of the speaker election Saturday morning.

CLICK HERE TO GET THE FOX NEWS APP

"The ‘Speaker’ selection process, as crazy as it may seem, has made it all much bigger and more important than if done the more conventional way," Trump said. "Congratulations to Kevin McCarthy and our GREAT Republican Party!"

Fox News' Peter Kasperowicz contributed to this report.