In a GOP leadership shuffle, Republican lawmakers voted Thursday for California Rep. Kevin McCarthy to succeed Rep. Eric Cantor as House majority leader after Cantor's unexpected primary defeat last week.

McCarthy, a fourth-term lawmaker who had held the No. 3 GOP position, was elected by secret ballot.

"America is struggling," he said after the vote. "We're struggling with a stagnant economy, a failed health care law, and so many are living paycheck to paycheck. They are looking for individuals that put people before politics. I make one promise: I will work every single day to make sure this conference has the courage to lead with the wisdom to listen."

The day's second election, to succeed McCarthy as party whip, was a much tighter three-way competition among Reps. Steve Scalise of Louisiana, Peter Roskam of Illinois and Marlin Stutzman of Indiana. Scalise, 48, scored the victory.

Scalise, who won his seat in a special election in 2008, campaigned as head of the Republican Study Conference, a group of that sometimes serves as a conservative thorn in the side of leadership.

"I'm looking forward to bringing a fresh new voice to our leadership table and joining with this team to help confront the challenges that people all across this country are facing," he said at a press conference following the vote.  "We've got solid conservative solutions that are going to solve the problems facing our country."

McCarthy and Scalise will govern for only 12 legislative days between when Cantor officially calls it quits on July 31 and November’s midterm elections.

Congress is off most of August, September and October.

Tension among Republicans has been brewing even before Cantor’s loss, with unhappy conservatives and Tea Party members jockeying for more say.

McCarthy, who faced Rep. Raul Labrador, R-Idaho, was believed to be way ahead going into Thursday’s voting.  McCarthy, 49, moved quickly to line up the votes for majority leader following Cantor’s loss in Virginia.

Members voting wrote the name of the candidate they wanted on slips of paper. There are currently 233 members of the House Republican Conference; about 117 votes were needed to win.

A bloc of a few dozen Republicans, mainly rock-ribbed conservatives, likely voted for Labrador as the "alternative" candidate to the "establishment."

Within moments of McCarthy’s election, the League of United Latin American Citizens issued a statement calling on him to schedule a vote in the House on legislation to overhaul immigration law, including a path to citizenship for millions of immigrants currently living in the country illegally.

The issue has long divided Republicans and figured prominently in Cantor's defeat a little more a week ago, when he was trounced by David Brat, a little-known, underfunded Tea Party-backed challenger.

Experts say Thursday’s vote is a dress rehearsal for a potential GOP leadership shakeup following November’s midterm elections. That battle for power could include House Speaker John Boehner, R-Ohio, who is up for re-election after the Nov. 4 midterms.

Fox News' Chad Pergram and The Associated Press contributed to this report.