Representative Tim Huelskamp, a member of the hard-line conservative Freedom Caucus, lost to a political newcomer on Tuesday in the Republican primary for his Kansas district.

Mr. Huelskamp, who was elected to Congress in 2010 and quickly earned a reputation for frustrating Republican leaders, was defeated by Roger Marshall, an obstetrician from Great Bend, in the primary for the First Congressional District, which covers western Kansas and much of the state’s center.

Mr. Marshall won with the support of business groups and the agriculture lobby, which had turned its back on Mr. Huelskamp after Speaker John A. Boehner had him removed from the Agriculture Committee in 2012, a crucial position for a legislator from a farm state. Mr. Huelskamp was a frequent critic of Mr. Boehner, who resigned last year amid strife with the Republican Party’s right wing.

“Getting kicked off the Agriculture Committee is a crime that can’t be forgiven,” Brian Scheideman, a 52-year-old driver’s education instructor, said after voting for Mr. Marshall in Wamego, The Associated Press reported. “I don’t mind the independent voice, but you’ve got to figure out how to work with people.”