Speaker Mike Johnson on Friday won re-election to the top post in the House, salvaging his job in a dramatic last-minute turnabout by putting down a revolt from conservatives who initially voted to block his ascent.
Mustering the majority he needed to win re-election on the first ballot, Mr. Johnson was ultimately able to save himself from the humiliation of the multiple-day slog of voting to which ultraconservatives subjected his predecessor, Kevin McCarthy. He won with just enough votes to clinch the gavel, 218 to 215.
But the chaotic and confusing scene that played out on the House floor — with three Republicans initially opposing Mr. Johnson and six more abstaining, waiting until it appeared he would lose before voting for him — reflected the deep divisions within G.O.P. ranks. That was a grim portent for Mr. Johnson and for President-elect Donald J. Trump at the dawn of the speaker’s second term as the new all-Republican Congress begins.
Both Mr. Johnson and Mr. Trump had urged Republican lawmakers to quickly elect him speaker so the House could start work on the president-elect’s ambitious and crowded agenda. But it became clear early into the vote on Friday that some of the hard-liners who had vented dissatisfaction with Mr. Johnson’s performance in the top post were intent on dealing him an embarrassing rebuke before allowing him to keep his job.
As their names were called by the House clerk, instead of voting, they stared defiantly ahead and remained silent.
By the time three other Republicans — Representative Thomas Massie of Kentucky, Keith Self of Texas and Ralph Norman of South Carolina — voted for lawmakers other than Mr. Johnson, it appeared that he was at risk of losing the gavel to Representative Hakeem Jeffries of New York, the Democratic leader.
But eventually, the six lawmakers who had initially withheld their votes changed them to support Mr. Johnson, a Louisiana Republican.
With three defectors, he was still short of the majority necessary to win re-election.
Mr. Johnson then huddled with two of the holdouts — first in the center aisle of the House floor, then in an adjacent room — as the vote was held open for nearly an hour.
They returned together to the floor, and Mr. Self and Mr. Norman strode to the center of the chamber and changed their votes with Mr. Johnson looking on, handing him the support necessary to win another term as Republicans stood and applauded.
Mr. Self later said in an interview that he changed his vote after Mr. Johnson agreed to include more members of the hard-right House Freedom Caucus in negotiations over the massive budget and tax bill they plan to pass later this year through a fast-track process that would let the measure avoid a Senate filibuster.
“We know that this will be a heavy lift to get the Trump agenda across the line in the reconciliation package, so we shored up the negotiating team,” Mr. Self told reporters. “That’s all we did.”
Mr. Self also said that Mr. Trump called him after he initially voted against Mr. Johnson, adding that they had a “lively discussion.”
Ultimately only one Republican, Mr. Massie, held firm in opposing Mr. Johnson.
But even before the newly minted speaker left the House floor on Friday, conservatives made clear that they still harbored deep skepticism about his ability to lead their conference, and would feel no compulsion to follow his lead unless he acceded to their policy dictates.
In a scathing letter, members of the House Freedom Caucus listed their demands, writing that they voted for Mr. Johnson only “because of our steadfast support of President Trump and to ensure the timely certification of his electors.”
“We did this despite our sincere reservations regarding the speaker’s track record over the past 15 months,” the lawmakers wrote.
Among their demands were that House Republicans “not increase federal borrowing” — as Mr. Trump has demanded they do — “before real spending cuts are agreed to and in place” and to ensure that the major tax and budget bill the conference was preparing to advance “reduces spending and the deficit in real terms.”
It all foreshadowed more headaches to come for Mr. Johnson, who will be working with a historically slim majority and an embittered group of conservatives.
Representative Chip Roy of Texas, one of the Republicans who initially abstained but then voted for Mr. Johnson at the very end, made it clear that his reservations about the speaker had not vanished and there was profound resistance to him in G.O.P. ranks.
“Everything we do needs to set the Congress up for success and to deliver the Trump agenda for the American people,” Mr. Roy wrote on social media. “Speaker Johnson has not made that clear yet, so there are many members beyond the three who voted for someone else who have reservations.”
Karoun Demirjian and Maya C. Miller contributed reporting.