Republican Kevin McCarthy has been elected US House speaker in a historic 15th ballot in the early hours of Saturday.
"Now the work begins," he said, after Republicans cheered and hugged the new speaker with chants of "USA, USA!"
McCarthy has overcome a lack of support from his own party and floor tensions in a chaotic week that tested the new GOP majority's ability to govern.
With a speaker elected, the House finally will be able to start swearing in newly-elected lawmakers who had been waiting all week for the chamber to formally open and the 2023-24 session to begin.
After four days of grueling ballots, McCarthy convinced more than a dozen conservatives to become supporters, including the chairman of the chamber's Freedom Caucus.
Michelle Mone's husband gifted Tories 'over £171k' as Covid PPE row rumbles onHe fell one vote short on the 14th ballot, and there were some unruly scenes as McCarthy confronted Republican Matt Gaetz, sitting with Lauren Boebert and others who had not backed him.
At one point, Republican Mike Rogers of Alabama started to move towards Gaetz before another Republican, Richard Hudson, physically pulled him back and someone shouted: "Stay civil!"
With order restored, the Republicans fell in line to give McCarthy the post he had fought so hard to gain.
The tally was 216-212 with Democrats voting for leader Hakeem Jeffries, and six Republican holdouts to McCarthy simply voting present.
The turn of events came after McCarthy agreed to many demands including the reinstatement of a longstanding House rule that would allow any single member to call a vote to oust him from office.
Even as McCarthy secured the votes he needs, he will emerge as a weakened Speaker, having given away some powers but he could also be emboldened as a survivor of one of the more brutal fights for the gavel in US history. Not since the Civil War era has a speaker's vote dragged through so many rounds of voting.
The showdown that has stymied the new Congress came against the backdrop of the second anniversary of the January 6, 2021, attack on the Capitol, which shook the country when a mob of then-President Donald Trump's supporters tried to stop Congress from certifying the Republican's 2020 election defeat to Democrat Joe Biden.
At the afternoon speaker's vote, a number of Republicans tiring of the spectacle temporarily walked out when one of McCarthy's most ardent challengers Gaetz railed against the GOP leader.
The possibility of a deal with conservative opponents, who had been blocking McCarthy's rise, had emerged after three dismal days and 11 failed votes in an intraparty standoff unseen in modern times.
One significant former opponent, Republican Scott Perry, chairman of the conservative Freedom Caucus who had been a leader of Trump's efforts to challenge the 2020 election, tweeted after his switched vote for McCarthy: "We're at a turning point."
500 deaths is criminal and you can't blame it on strikers - Voice of the MirrorAnother, Byron Donalds, of Florida, who was repeatedly nominated as an alternative candidate for speaker, switched on Friday, too, voting for McCarthy.
Trump may have played a role in swaying some holdouts - having called into a meeting of Republican freshmen the night before, and called other members ahead of voting. He had urged Republicans to wrap up their public dispute.
The House adjourned until late in the night, giving time for last-minute negotiations and for two absent Republican colleagues time to return to Washington.
Newly elected Wesley Hunt of Texas arrived to vote for McCarthy - to applause days after his wife had given birth to their newborn - as did Ken Buck of Colorado.
The disorganized start to the new Congress pointed to difficulties ahead with Republicans now in control of the House, much the way that some past Republican speakers, including John Boehner, had trouble leading a rebellious right flank. The result: government shutdowns, standoffs and Boehner's early retirement when conservatives threatened to oust him.
The agreement McCarthy presented to the holdouts from the Freedom Caucus and others centers around rules changes they have been seeking for months. Those changes would shrink the power of the speaker's office and give rank-and-file lawmakers more influence in drafting and passing legislation.