When Representative Tom Cole became chairman of the Appropriations Committee in April, it marked the first time an Oklahoman had ascended to one of Congress’s most powerful perches.

For 15 years on the panel, Mr. Cole, a Republican, quietly climbed its ranks with the gavel in mind, crafting and negotiating bipartisan spending bills. All the while, he tucked in projects for his state — its universities, hospitals and airports — to the tune of billions of dollars.

But now just two months into his role, his carefully laid plans could be upended, and with them, Oklahoma’s direct line to federal funds.

On Tuesday, he will face the stiffest threat to his career yet: a primary challenge from a self-funded conservative, Paul Bondar, who is running on an anti-spending platform. With more than $8 million poured into the race, it has become one of the most expensive House primaries this year.

Mr. Cole’s gavel once would have afforded him a political advantage. The leaders of the appropriations panels are able to leverage power and curry favor at home by steering federal dollars to build up local infrastructure.

But in today’s Republican Party, where the right flank is ascendant and spending has become a dirty word, being an institutionalist adept at wielding influence to bring home federal money is increasingly seen as a political liability.