Washington — A key group of hard-right U.S. House Republicans endorsed a dark-horse candidate Wednesday for speaker of the House, throwing a potential monkey wrench into the plans of House Majority Whip Steve Scalise, R-Jefferson, to rise to the No. 2 position of majority leader.

That’s because the favorite to win the election for speaker — Kevin McCarthy, of California — is the incumbent majority leader. Scalise’s ambition to move up from whip, the No. 3 post in the leadership hierarchy, depends on McCarthy vacating his current position.

McCarthy is expected to get the endorsement of the House Republican Conference — the official organization of the 247 House Republicans — at its meeting Thursday. But speaker is a constitutional post, elected by the full 435-seat House in a public vote, scheduled for Oct. 29. A defection of 30 Republicans from the conference-endorsed candidate would deny the nominee election, if, as expected, Democrats vote unanimously for their leader, Nancy Pelosi, of California.

The endorsement Wednesday by the House Freedom Caucus of Daniel Webster, of Florida, for speaker sharply increases the likelihood of that outcome. Should no candidate win a majority Oct. 29, additional votes would be required until someone rounds up the support of 218 members.

The House Freedom Caucus is a group of about 40 members organized early this year to push the Republicans’ agenda harder to the right.

The scramble among the majority Republicans was touched off Sept. 27 when Speaker John Boehner, of Ohio, stunned the House by announcing that he would step down at the end of October. Boehner faced repeated challenges to his leadership from dyed-in-the-red-wool conservatives who reject compromises on issues such as immigration, defunding Planned Parenthood, the Iran nuclear deal and others that would run into the stone wall of a veto by Democratic President Barack Obama if pushed that far.

Scalise, 50, is considered a strong contender for majority leader. If he wins the post, he would be the highest-ranking member of Congress from Louisiana since New Orleans Democrat Hale Boggs served as House majority leader in 1971-72 before disappearing on a flight in Alaska.

His main opponent is Budget Chairman Tom Price, of Georgia, who has corralled some key endorsements.

Scalise remains confident McCarthy will be elected speaker, a Republican legislative staff source familiar with the dynamics of the leadership contests said late Wednesday.

The majority leader consults with the speaker on policy and manages the flow of legislation on the House floor. The whip counts Republican votes and rounds up support for the leadership agenda. Both those positions are filled by a majority of the Republican Conference voting by secret ballot, and those elections, if necessary, would take place after Boehner’s successor is chosen.

Scalise, who was first elected to Congress in 2008, was chosen as majority whip in June 2014.