WASHINGTON — House Republicans have made the first change in their leadership since Majority Leader Eric Cantor unexpectedly lost a primary election last week. They’ve elected California Rep. Kevin McCarthy to replace him in the No. 2 job.

The 49-year-old McCarthy has been GOP whip, the No. 3 post, and his election Thursday was anticipated. He defeated Idaho Rep. Raul Labrador, a conservative who has often battled his own party leaders and said voters want change in Washington.

McCarthy came to Congress in 2007 and has climbed rapidly through his party’s leadership ranks. He’s a close Cantor ally.

House Republicans will also choose a new whip to replace McCarthy. That’s a hard-to-predict contest between Reps. Peter Roskam of Illinois, Steve Scalise of Louisiana and Marlin Stutzman of Indiana.