Rep. Kevin McCarthy’s election as House majority leader continued one of the swiftest political ascents in congressional history and marked another triumph for establishment Republican forces over the party’s conservative flank.

House Republicans chose the Bakersfield congressman to replace Rep. Eric Cantor of Virginia as their leader in a secret ballot Thursday, slightly more than a week after Cantor’s shocking defeat in a primary election.

McCarthy’s elevation from majority whip represents a change of style, but likely not the shift to a more confrontational approach some conservatives had called for. McCarthy is widely considered more genial than Cantor and has closer personal ties with many members, but worked closely with him and shares many of his views.

To replace McCarthy in the leadership’s third-ranking job, GOP lawmakers chose Rep. Steve Scalise of Louisiana, chairman of the largest organized group of conservative lawmakers in the House. His victory was welcomed by allies of House Speaker John A. Boehner (R-Ohio), who viewed it as a nod to the restless right that could balance out the leadership team.

In brief remarks to reporters after the votes, surrounded by other members of the leadership, McCarthy promised to make sure House Republicans had “the courage to lead with the wisdom to listen.”

“We'll turn this country around,” he vowed.

Scalise said he was “looking forward to bringing a fresh new voice to our leadership table.” He defeated Illinois Rep. Peter Roskam, the chief deputy whip, and Indiana Rep. Marlin Stutzman after only one round of voting.

Though policy fights that can split Republicans loom in the months ahead — a promised vote on an alternative to President Obama’s healthcare law, a new government funding measure due by Oct. 1, and a possible fight over the fate of the Export-Import Bank — those seeking to change the House leadership more dramatically proved unable to mount more than a rhetorical challenge.

McCarthy’s sole challenger was Rep. Raul R. Labrador (R-Idaho), a second-term lawmaker who announced his bid only last Friday. His support was limited to some of the House's most conservative members.

“You would think that people who have been plotting this big takeover of leadership for months and months and months or years, that you would at least have a plan to move forward,” said Rep. Devin Nunes (R-Tulare), long a critic of what he now calls the “exotic club” of tea party members in the GOP ranks.

In a gesture to promote unity, Labrador released his votes after the outcome was announced in the closed-door meeting, saying the vote should be unanimous. But some of the lawmakers who have vexed leadership in recent years said McCarthy should not assume he would hold the post for long.

“It may not be a stable arrangement,” said Rep. Thomas Massie (R-Ky.). “Let's give him a chance, two to three months in front of the cameras, see how he does.”

Rep. Justin Amash (R-Mich.) said he already had heard from other members who wanted to pose another challenge in November, even though he acknowledged that such an election would be more difficult.

“Today was our best chance to change things at the top,” Amash said. “I don’t think the results today are going to satisfy ordinary Americans. I’m not talking about tea party — ordinary Americans, regular Republicans.”

More moderate Republicans saw McCarthy’s election as a clear victory for their side.

“Some of our members have to understand that if the job of the majority leader were to get everybody to vote no, then the other guy would have won,” said Rep. Charlie Dent (R-Pa.), one of the few moderates in the caucus.

Still, even those who seemed pleased with the outcome appeared uncertain about the new leadership’s durability.

“It’s the leadership for the next couple of months,” said Rep. Joe L. Barton (R-Texas). “We really do have new energy, new unity — perhaps.”

House Republicans will not have long to decide whether they’re happy with the new team. Cantor leaves the majority leader’s office at the end of July. Because of the long August recess and time off for campaigning in the fall, the House has only 12 workdays scheduled between then and the date on which new elections would take place the week after the midterm balloting.

McCarthy, 49, will be the first Californian to serve in the House's second-ranking position when he formally assumes the role. First elected in 2006, he has served since 2011 as the House majority whip.