In the end, Iowa was a must-win state for Ted Cruz, and he pulled it out despite weeks of withering attacks from Donald Trump.

For Cruz, projecting the winner by Fox News and other networks, capturing the caucuses here is a bigger victory than just beating Trump by a few thousand votes. The press and the Republican power brokers originally viewed him as a middle-tier guy, a bomb-thrower in Washington, and not a charming personality to boot.

He stuck to his strategy of hard-line conservatism, courting evangelicals, bashing the media—and parrying Trump’s assaults better than any other Republican candidate.

Cruz appeared to be slipping in recent weeks as Trump questioned his Canadian birth and called him a nasty guy, and he had his worst debate in last week’s Fox faceoff in Iowa. But he had a resilient base of support in this state.

For Trump, the loss clearly dents his shield of invulnerability. But a billionaire mocked by much of the establishment showed he could mount a competitive race, he's far stronger in New Hampshire and South Carolina, and he has all the money he needs. Perhaps a dose of humility will be good for him.

It’s hard to know whether Trump skipping the Fox debate was a factor among late deciders, or his big-rallies-over-county-fairs approach. We do know that Cruz had a much stronger ground game, and with Iowa’s complicated caucuses, that still matters.

Rubio’s surprisingly strong third-place finish, which put him close to Trump, vindicates his strategy of trying to emerge as the establishment alternative. The Florida senator got traction at just the right time, brilliantly managed the expectations game, and comes out of Iowa (where he didn't play that hard) firmly in the top tier with Trump and Cruz, heading into better states for him.

But before we get completely swept away by the media hype, Iowa, with its strong evangelical vote, is a unique battleground. Four of the last GOP winners in Iowa have failed to win the nomination. In just eight days, Trump could be buoyed by a huge victory in New Hampshire. The Iowa afterglow is intense, but short-lived.

On the Democratic side, Hillary Clinton was leading Bernie Sanders by an extraordinarily thin margin, possibly avoiding the possibility of an 0-for-2 start in the state that crushed her hopes against Barack Obama. But let’s be honest: The race shouldn’t even be close. A former first lady, a former secretary of State, a Clinton, should clobber a 74-year-old socialist who hadn’t even been a member of the Democratic Party. But she is an establishment candidate in an anti-establishment year. Whatever the final numbers, this is a moral victory for Sanders and certification of his grass-roots appeal.

What’s striking among Republicans is how the last two Iowa winners, Rick Santorum and Mike Huckabee, finished below 2 percent, along with once-hot contender Carly Fiorina and Chris Christie, who is betting his campaign on New Hampshire.

The early signs were good for Trump, as one wave of Fox entrance polls showed Trump barely trailing Cruz among evangelical Christians, Iowa’s key voting bloc, 26 to 24 percent—with Rubio at 21 percent. Those voters are Cruz’s key constituency, and perhaps he lost some crucial supporters to Ben Carson, who hung in at about 10 percent.

The entrance polls showed Trump dominating among voters whose most important quality was a candidate who “tells it like it is.” Cruz did best among voters seeking a candidate who “shares my values.” Rubio was strongest as the candidate who “can win in November.”

The latest headlines on the 2016 elections from the biggest name in politics. See Latest Coverage →

Demographically, Trump did best among voters with a high school education or less, while Rubio edged Cruz among college graduates and those who did postgraduate study. Cruz, not surprisingly, did best among very conservative voters, Trump scored highest with moderate voters, and Trump and Rubio were essentially tied among somewhat conservative voters.

On the Democratic side, according to those entrance polls, Hillary Clinton dominated among voters over 65, while Bernie Sanders clobbered her in the 17-to-29 age group.

Sanders decimated the former first lady among those most interested in an “honest and trustworthy” candidate and one who “cares about people like me.” Clinton creamed him for having “the right experience” and as someone who “can win in November.”

Howard Kurtz is a Fox News analyst and the host of "MediaBuzz" (Sundays 11 a.m. and 5 p.m. ET). He is the author of five books and is based in Washington. Follow him at @HowardKurtz. Click here for more information on Howard Kurtz.