Rep. Tim Huelskamp (R-Kan.) answers a question during a debate with his Republican primary challenger, Roger Marshall. (Travis Morisse/Hutchinson News via AP)

It was the classic conservative vs. establishment battle, only this time the battle lines were flipped — and the establishment won.

Rep. Tim Huelksamp (R-Kan.), a tea party leader, lost his primary Tuesday night to challenger Roger Marshall, an OB/GYN who campaigned as a conservative willing to work with House leadership. Outside groups spent millions trying to influence the race; billionaire Koch brother-affiliated groups on Huelskamp's side, big business on Marshall's side.

The race became an ideological battle about whether there is such a thing as saying "no" too much in Congress. The voters of Kansas's 1st Congressional District appear to have decided that yes, there is.

But don't expect the tea party to come crumbling down after Huelskamp's loss. Tuesday's establishment victory could also be difficult to repeat because Huelskamp's perceived weaknesses were so specific to the district.

Let's run down everything you need to know about it:

How badly did Huelskamp lose?

Pretty soundly. When the Associated Press called the race with 72 percent of precincts reporting, Marshall had 57 percent of the vote to Huelskamp's 43 percent.

Why did he lose?

Although it can be tough to answer that question for certain, the race framed around one low point for Huelskamp in 2012. That's when former House speaker John A. Boehner (R-Ohio) decided to punish Huelskamp for not going along with leadership by kicking him off the Agricultural Committee. For a congressman from rural Kansas, that was a pretty big blow. Huelskamp also lost his seat on the Budget Committee.

Huelskamp didn't help regain the confidence of his state's agricultural lobby when he voted against the farm bill, a key piece of legislation for his district, because he said it was too expensive.

“Tim has just kind of put himself in a position where he’s become irrelevant in Washington," Warren Parker, with the Kansas Farm Bureau, told National Review's Alexis Levinson days before the primary. "He can’t seem to work with others whether in his party or out."

What was each candidate's pitch?

Huelskamp: That he'll stick it to Washington. Even though he had been in office for five years, Huelskamp leveraged his role as the header of the House's tea party caucus to pitch himself as an outsider. "It’s about insiders versus an outsider," Huelskamp told Levinson.

Marshall: That he'd play the Washington game. That he'd vote conservative, yes, but that he'd also balance his district's needs with his party's. That might mean taking some unsavory votes, but his plan doesn't upset leadership so much that he gets kicked off the Agricultural Committee.

Who were the big players that turned this into a proxy battle?

The players weren't new, but the sides they took were. Conservative groups used to propping up challengers to centrist Republican incumbents found themselves backing an incumbent.

On Huelskamp's side: The Club for Growth and Americans for Prosperity, one of the main political arms for libertarian billionaires Charles and David Koch.

On Marshall's side: Big-business and agricultural groups, like the Chamber for Commerce and the influential Kansas Farm Bureau, found themselves trying to oust an incumbent.

So what does this mean for the tea party?

It may function as a cautionary tale. Marshall's victory is a big one. One of the most difficult things to do in politics is kicking out an incumbent, especially one who matches up ideologically with the district. The 1st District much of the state, is largely rural and one of the most conservative in the country. Huelskamp's been representing the district since 2011, when he got elected on a tea party wave.

That said, it's hard to extrapolate much more than a warning to tea party lawmakers. This race dealt specifically with Kansas issues (agriculture), and tea party opponents had something specific to point to (Huelskamp getting kicked off the agricultural committee) that not every conservative vs. establishment battle will have, said Molly Reynolds, a congressional analyst with Brookings Institution.

Also interesting: Moderate Republicans had a great night in Kansas overall, winning at least five closely watched state house races. 

Paradoxically, Huelskamp's loss could also embolden conservative groups.

It's possible the House Freedom Caucus — that perpetual thorn in leadership's side — sees Huelskamp's loss as a slight by party leadership, who failed to support one of their own.

Sure enough, the head of that group, Rep. Jim Jordan (R-Ohio) put out a statement Tuesday blaming Republican leaders for Huelskamp's loss.

"At times, Tim's commitment to fighting for smaller, more accountable government required him to stand up and say no to 'business as usual' in Washington," Jordan said.

Nathan Gonzales in Roll Call thinks Huelskamp's loss could manifest itself in more conservative vs. establishment primary battles.

"Some Freedom Caucus members are feeling jaded enough for their fallen Kansas colleague to explore more aggressive options against Establishment embers in the future," he wrote.

In some ways, this was a no-win scenario for Huelskamp.

"At the end of the day," Reynolds said, "voters sympathetic to the tea party value ideological commitments on the part of their representatives. But they also want government to deliver the benefits they are accustomed to receiving."