Kevin McCarthy has been elected Speaker of the US House of Representatives amid heated exchanges which almost saw fellow Republicans come to blows.
Mr McCarthy finally won the job after 15 rounds of voting, despite his party holding a majority in the chamber.
It came after a dramatic pressure campaign played out live on the House floor as party rebel Matt Gaetz was urged to vote for Mr McCarthy.
The Florida Congressman was among six holdouts who relented late on Friday.
Earlier, amid heated scenes in the chamber, Mr Gaetz had almost come to blows with Rep Mike Rogers – a supporter of Mr McCarthy. The Alabama congressman had to be physically restrained by colleagues as he bellowed and jabbed his finger at Mr Gaetz.
The Speaker sets the House agenda and oversees legislative business. The post is second in line to the presidency after the US vice-president.
Speaking after his confirmation, Mr McCarthy wrote on Twitter: “I hope one thing is clear after this week: I will never give up. And I will never give up for you, the American people.”
US President Joe Biden congratulated Mr McCarthy for his win and said he looked forward to co-operating with the Republican Party.
“The American people expect their leaders to govern in a way that puts their needs above all else, and that is what we need to do now,” he said.
Republicans have already pledged to launch investigations into Mr Biden’s family business dealings and administration.
After the 13th ballot was adjourned, Mr McCarthy insisted to reporters that he would “have the votes” to take the speakership on the next round.
In a remarkable turnaround in the 12th round of voting, Mr McCarthy was able to persuade 14 Republican holdouts to cast their vote for him. A 15th rebel followed suit for the 13th ballot.
But the California congressman was still three votes short of the 217 he needed to take the prized gavel, and in chaotic and dramatic scenes, he again failed to win on the 14th ballot.
The dissidents included members of the House Freedom Caucus, who argue that Mr McCarthy is not conservative enough to lead them as they work to stymie Democratic President Joe Biden’s agenda.
Mr McCarthy has offered various concessions to the rebels, including a seat on the influential rules committee, which sets the terms for debate on legislation in the chamber.
He also agreed to lower the threshold for triggering a vote on whether to unseat the Speaker, to only one House member, leading to the possibility that the Republican coalition could easily fracture again even after Mr McCarthy’s victory.
Senior Democratic Party lawmakers accused Mr McCarthy of ceding power to an extreme wing of his party and likened the stand-off to the riot exactly two years ago on Capitol Hill by Trump supporters who disrupted Mr Biden’s certification as president.
“Two years ago insurrectionists failed to take over the Capitol,” Congressman Eric Swalwell wrote on Twitter. “Tonight Kevin McCarthy let them take over the Republican Party.”
And Virginia Congressman Don Beyer referred to the angry scenes among Republicans that followed the 14th count.
“Unsettling that this process ends in threats of violence in the House Chamber, on this of all days,” he said. “Maybe it didn’t determine the outcome, but that is no way to conduct the people’s business. A dark and sobering moment will probably be remembered long after this session ends.”
The minority Democrats had continued to vote in unison for their leader, New York’s Hakeem Jeffries, the first black person ever to lead a party in Congress.
Friday was the first day that Mr McCarthy’s vote count actually surpassed that of Mr Jeffries.
Not since 1860 in the build-up to the American Civil War has the lower chamber of Congress voted this many times to pick a speaker. Back then it took 44 rounds of ballots.
In November’s midterm elections, Republicans won the House by a weaker-than-expected margin of 222 to 212. Democrats retained control of the Senate.