The final tally was 216 votes for McCarthy.

He was able to be elected with the votes of fewer than half the House members, only because six in his own party withheld their votes.

That meant not backing McCarthy as leader, but also not voting for another contender.

Speaking to the media afterwards, the 57-year-old Californian credited former president Donald Trump's trust in him for landing him the Speaker role.

"I do want to especially thank President Trump. I don't think anybody should doubt his influence. He was with me from the beginning. Somebody wrote the doubt if it was there and he was all in. He would call me and he would call others. And he really was - I was just talking to him tonight - helping get those final votes. What he's really saying, really for the (Republican) party and the country, that we have to come together."

McCarthy suffered one final humiliation when Representative Matt Gaetz withheld his vote on the 14th ballot as midnight approached, prompting a scuffle in which fellow Republican Mike Rogers had to be physically pulled away.

McCarthy had to agree to compromises - including a demand from right-wing hardliners that opposed him, that a vote could be called at any time to challenge his leadership.

That would give hardliners extraordinary leverage, when Washington debates funding the government amid soaring inflation.

McCarthy had failed 14 times in a row to secure the House Speaker position - the highest number of ballots for the speakership since the turbulent years before the Civil War.

In his inaugural speech, he listed out a wide range of priorities from cutting spending to immigration, to fighting culture war battles.

House Democratic Leader Hakeem Jeffries in his speech raised questions about McCarthy's ability to govern his caucus - given his bungled speakership bid.

"As we transition from one Congress to the next, from one majority to the next, from a year of accomplishment to a year of ambiguity. // The American people understandably after the events of this week recognize that the Congress is at a fork in the road."