Sen. Jeff Sessions (R-Ala.), shown in Oct. 2013, was in line for the chairmanship of the Budget Committee, but may be a more confrontational voice than party leaders are looking for. (Drew Angerer/Getty Images)

Jeff Sessions (R-Ala.) and Mike Enzi (R-Wyo.) were elected to the Senate on the same day in 1996, but Enzi holds seniority over his longtime friend through a totally random feature of party rules: They drew names out of a hat.

That quirk of history has led to a showdown over the chairmanship of the Budget Committee that has caused a backlash among conservatives, who say Enzi is unfairly laying claim to the powerful position at the behest of party leaders.

Sessions has been serving as the top Republican on the committee for the past four years and was in line to take the chairmanship after the GOP won control of the Senate this month.

But since then, Sessions has undercut party leaders with his strident opposition to President Obama’s immigration action, even raising the specter of another fiscal showdown that resembles previous confrontations with the White House. Party leaders are eager to fight back against the president, but in a more measured way in line with their desire to show that they are up to the task of governing.

That has provided an opening for Enzi, whose name-out-of-a-hat seniority gives him the standing to challenge Sessions and who is pitching himself as a less-confrontational alternative.

Conservative activists say GOP leaders are backing Sen. Mike Enzi (R-Wyo.) for the chairmanship because he would be a more reliable party man. (J. Scott Applewhite/AP)

Minority Leader Mitch McConnell (R-Ky.) and other members of his team have publicly stayed out of the contest, but conservative activists nevertheless say they are quietly backing Enzi because he would be a more reliable party man.

Gaston Mooney — who served as an aide to former senator Jim DeMint (R-S.C.), who often clashed with McConnell’s leadership team — wrote in an article last week in Conservative Review: “If Sessions loses the chair of the budget committee, it is only under the orders and direction of McConnell.”

Enzi’s advisers reject the idea that he’s making a run at the leadership’s bidding, instead stressing his experience on fiscal matters such as health care. McConnell’s office issued a strong denial of playing any role.

“The only members who decide the chairman are the Republican members of the committee. The leadership plays no role,” Don Stewart, McConnell’s spokesman, said Wednesday.

Sessions has spent his three terms in the Senate advancing a conservative agenda and has become one of the most reliable voices opposing Obama. He can be every bit as confrontational as his much-better-known colleague Ted Cruz (R-Tex.), with the key difference being that Sessions actually holds power and position within the Senate.

On immigration, Sessions has been the leading voice among Republicans who want to use the budget process to try to force Obama to back off his unilateral decision to offer protections to illegal immigrants.

Republicans who disagree with that strategy think that a better counter to Obama’s action would be to pass a border-security bill and other conservative immigration legislation and send it to the White House, rather than cutting off the budget and risking even a partial shutdown of government agencies.

Aware that critics say his approach will lead to a shutdown, Sessions has repeatedly vowed that if push came to shove, he supports funding the government. But he has been vague on how his strategy would work once the president vetoed legislation that included restrictions on implementing the immigration order.

“We should be cautious, we should be responsible. I’m going to tell you, that is exactly correct: We don’t need to shut this government down, we’re going to fund the government,” he said.

If Sessions wins the chairmanship, the implications for the GOP are more than temperamental or confined to immigration. On the policy front, Sessions is an independent thinker — a deeply ideological conservative who is very open to using the budget as a political weapon.

When House Republicans and Senate Democrats cut a bipartisan budget deal late last year, Sessions forcefully opposed the compromise, breaking with Rep. Paul Ryan (R-Wis.), the House Budget Committee chairman. Sessions argued that the agreement too easily adjusted levels of discretionary spending, and he balked at the inclusion of new federal fees.

Reluctant to criticize his old friend, Sessions is laying out his case of having done hard work over the past four years as the ranking Republican on the committee, and being ready to do the job on Day One. “Look, Enzi can do the job. He’s got sound values. I just have given a lot of thought to it and would like the opportunity to do it. We’ll keep talking, and our colleagues will ultimately get to decide,” he said.

The electorate for this race is tiny: The 10 or 12 Republicans who will be on the Budget Committee next year will vote, and whatever they decide will almost certainly be honored when the full Republican caucus weighs in.

Republicans have not had a contested battle for a top committee post since 1987, when Jesse Helms (N.C.) used seniority to trump Richard Lugar (Ind.) for the leading spot on Foreign Relations.

Short in stature and possessing a quirky, high-pitched Southern drawl, Sessions, 67, is sometimes overlooked, but he’s rarely out­hustled. He won a fourth term to the Senate three weeks ago without any opposition whatsoever, either in a primary or the general election.

The early focus for Sessions was the law, graduating from the University of Alabama School of Law in 1973. In 1981, President Ronald Reagan appointed him to be the U.S. attorney for the state’s Southern District, beginning an unusually long 12-year stint that spanned two GOP administrations.

His nomination for the U.S. District Court in Alabama became a racially charged moment in 1986 amid accusations of mishandling a voter-fraud case against civil rights activists, and his ultimate rejection for the lifetime appointment set him on a political path.

In 1996, he won the Senate seat of Howell Heflin (D), whose vote against Sessions a decade earlier was pivotal to his nomination’s defeat. His focus for years was on the Senate Judiciary Committee, where he defended the George W. Bush administration’s aggressive tactics to fight terrorists.

His first battle with his own party on immigration came during the Senate’s 2006 debate on bipartisan legislation that would have led to a path to citizenship for some illegal immigrants — a bill that the Bush White House backed but which Sessions labeled “fatally flawed.”

By 2009, Sessions became the ranking GOP member of the Judiciary Committee, where he played the role of leading the attack against Obama’s Supreme Court nominees. Despite Sessions’s sharp conservatism, Justices Sonia Sotomayor and Elena Kagan won confirmation in a fairly amicable process.

Republican rules on term limits for top committee slots forced Sen. Charles E. Grassley (Iowa) out of another key post in 2011, and Grassley’s seniority trumped Sessions’s at Judiciary. Even though he wasn’t the most senior at Budget, other Republicans, including Enzi, had picked more prime committees, and the legal expert found himself serving as the top GOP senator on fiscal matters.

In the minority, Sessions did not hold nearly the same clout as his House counterpart, Ryan, the Budget chairman who became the ideological standard-bearer for this decade’s fiscal conservatives.

His biggest break from the fiscal-hawk wing has been that Sessions has shown a knack for Southern conservative populism on some issues. He recently advocated walling off Medicare and Social Security trust funds to protect their finances, rather than the ­Ryan-style voucher programs, and he often talks about “fair trade deals” that protect U.S. workers that sound ideologically similar to Northern Democrats.

Sessions was not a central negotiator in the four fiscal showdowns that Republicans had with Obama and Senate Democrats the past four years.

In fact, over the past two years, Sessions has made his biggest mark being the leading Republican opponent to immigration legislation, first on a bipartisan vote in 2013 and now on Obama’s executive action.

His confrontational style has scared some congressional Republicans, who want to avoid even talk of a possible government shutdown and argue that the 2016 GOP presidential nominee cannot alienate the Hispanic vote to have any chance at victory.

Enzi is no moderate, but he has worked with Democrats, including the late Edward M. Kennedy (D-Mass.) and Max Baucus (D-Mont.), the former senator who is now ambassador to Beijing. His head-down approach has not earned him praise in the tea party era of confrontation, and for a brief time he drew a primary challenge from Liz Cheney, the daughter of the former vice president.

Enzi fought back hard and eventually cruised to reelection. He has been setting up one-on-one meetings with members of the budget panel in what is the most insidery of insider races in Washington.

“Jeff and I are talking,” Enzi said late last week, unclear whether the issue would go all the way to a rare vote on who gets the gavel. “I don’t know. We’ll keep working on it. We’re good friends.”

His public selling point has been that he holds a more senior post on the committee and that two years ago, when Republicans were still in the minority, he passed on asserting his seniority and allowed Sessions to maintain his perch.

But that seniority is based entirely on the quirky GOP rules. A handful of Republicans won their first Senate term in 1996 without any prior experience as a governor or member of the House, so under party rules seniority was determined by drawing names from a hat.

Sessions was the last name drawn, and now he’s squaring off against his old friend in a race that has caused anxiety among their colleagues.

“I hope they work it out,” said Ron Johnson (R-Wis.), a member of the Senate Budget Committee. “That would be best for everybody.”

Robert Costa contributed to this report.