In the end, it wasn't even close. Kansas congressman Tim Huelskamp lost the Republican primary for his seat to a political novice, obstetrician Roger Marshall, by 15 points. Local news station KWCH reported just an hour after polls closed Tuesday night that Huelskamp's campaign staff "has told media members to leave the watch party for tonight's primary election." That was the first and most telling indication the sitting Republican was toast.

Huelskamp is the fourth incumbent GOP House member to lose his party's nomination this year and the first to lose to a genuine challenger, not a fellow congressman in a redistricted match-up. A three-term House member who came to Washington in the Tea Party wave of 2010, he was viewed—depending on who you are—either as a principled leader among the most conservative House Republicans or as a troublemaking rabble-rouser who made the perfect the enemy of the good.

In the House, Huelskamp has been an ally of Texas senator Ted Cruz, even as Cruz's political team's loyalties were split in the Kansas House Republican primary. He's often taken the most extreme stand on spending issues, which earned him plaudits from talk radio and conservative interest groups. Huelskamp's decision in 2012 to not support the Paul Ryan budget proposal after supporting a nearly identical version in 2011, however, frustrated House colleagues who were seeking party solidarity on an ambitious policy. And they grew even more frustrated with Huelskamp's tendency to vote against procedural measures on bills, particularly on those bills Huelskamp would end up supporting anyway.

The unwillingness to play on the Republican team is what led to House leadership stripping Huelskamp, among a few others from the "Freedom Caucus" of hardcore conservatives, of some key committee assignments in 2012, including the agricultural committee. Conservatives labeled it an ideological "purge," though many of the conference's most conservative members were given promotions at the same time as Huelskamp's demotion. It may have had more to do with, as one congressman from Georgia put it at the time, the "a—hole factor."

Huelskamp's removal from the agricultural committee nearly four years ago likely doomed him in 2016. His opponent, Roger Marshall, was supported by agriculture industry interests and the U.S. Chamber of Commerce's political arm, while an influential PAC funded by Republican donor Joe Ricketts spent money in the primary against Huelskamp. The overall pro-Marshall message was that Huelskamp was both too extreme and not influential enough to be an effective member of Congress for Kansas. The outsider congressman was given a seat on the House Republican steering committee, which helps determine conference policy and strategy, after Paul Ryan became speaker last year. But the position had less cachet in Kansas than his more plum role on agriculture.

The establishment money certainly boosted Marshall—in total, campaign cash spent in his favor was just under $1.5 million—yet it was hardly an unfair fight. Allies of Huelskamp (including the Club for Growth) and the congressman's own campaign fund spent more than $1 million themselves. But pro-Marshall forces spent bigger on advertising in the final weeks of the campaign, which likely sealed Huelskamp's fate.

Marshall is almost certain to win the heavily Republican west Kansas district in November—there's not even a Democrat on the ballot.