Iowa voters long flirted with the populist-fueled campaign of Donald Trump, who tapped into a deep vein of voter frustration and captivated huge crowds. But when it came time to caucus, Iowa Republicans gave Texas U.S. Sen. Ted Cruz a huge victory in the nation’s first vote.

Democrats Hillary Clinton and Vermont U.S. Sen. Bernie Sanders, meanwhile, were deadlocked in a nail-biter with 93 percent of precincts reporting.

Trump and Sanders drew thousands to raucous rallies across Iowa with brash promises to remake the federal government.

Yet droves of Iowa voters gave Cruz their stamp of approval amid a surge of turnout in the caucus. And Florida U.S. Sen. Marco Rubio seemed to consolidate support among mainstream Republicans looking for an alternative to Trump and Cruz.

On the Democratic side, Sanders threatened Clinton’s aura of inevitability with a blend of economic populism and appeal to young, liberal voters with promises to expand federal government with a massive jobs program.

She fought back, though, with a far better showing than she had in Iowa when she fell to Barack Obama in 2008.

Cruz strong in rural areas

Trump, a billionaire Manhattanite, has transformed himself into a populist voice for the frustrated and angry. Polls consistently showed he was particularly popular among religious conservatives who were willing to look past his vulgar language, his three marriages and his reality TV persona for his brand of tough talk.

“We have a do-nothing Congress. It’s totally incompetent. Nothing seems to get done. And I don’t know if Trump can change the dynamic, but it’s so divided it’s worth a shot,” said Larry DeChant, a former schools administrator who rallied for Trump at a Council Bluffs event.

Iowa’s deeply conservative GOP electorate, though, is made for an ideological purist, and Cruz positioned himself as the most unwavering hard-right Republican in the race. He crisscrossed each of Iowa’s 99 counties with a call for a religious awakening to sway the state’s overwhelmingly conservative and evangelical electorate, racking up big margins in rural enclaves.

Rubio, meanwhile, finished well ahead of former Florida Gov. Jeb Bush, Ohio Gov. John Kasich and other so-called establishment GOP figures as he made a case for mainstream Republicans to coalesce around him.

“This is no ordinary election. 2016 is not just a choice between two political parties. 2016 is a referendum,” Rubio said late Monday, making the case he’s the best GOP candidate to challenge Clinton in November.

Democratic race tight

Clinton has been stung by Iowa’s voters before, finishing a surprising third in 2008 in a vote that propelled Obama to the top of the Democratic pack. This cycle, her campaign snapped up many of Obama’s operatives and engineered a vaunted voter information drive.

Her campaign has always viewed the South, where she hopes to leverage her support among black Democrats, as a firewall. But her operatives long dreaded the prospect of losing Iowa yet again, and she appealed to women with the argument that she can finally break the White House’s glass ceiling.

“Voters here in Iowa know that Hillary Clinton is a fighter and that she’s going to stick with it,” said Robby Mook, Clinton’s campaign manager. “People know they’re going to make history.”

Sanders, though, mounted an unexpectedly robust challenge to Clinton with an unabashedly liberal campaign. He revved up crowds of thousands across the state by pledging to expand health insurance, fund tuition-free public higher education and launch a wave of new infrastructure projects.

Former Maryland Gov. Martin O’Malley, the dark horse candidate who failed to gain traction with voters, appeared ready to drop out of the race late Monday after getting less than 1 percent of support in early returns.

More moderate territory next

Iowa’s population is much whiter, less diverse and more rural than most of America. And it’s had an uneven record of picking the eventual nominee, with the past two GOP caucus winners losing steam after Iowa.

But the caucus has for decades been a proving ground for presidential contenders who typically must perfect a blend of retail politics and organizational might to persuade Iowans to gather at 7 p.m. on a weekday night to pick their favorite candidate.

The night’s results will also put the squeeze on some of the also-rans in the crowded field to quit. Former Arkansas Gov. Mike Huckabee, the 2008 Iowa caucus victor, suspended his campaign late Monday. Ex-Pennsylvania U.S. Sen. Rick Santorum, who won the contest in 2012, will face tremendous pressure to bow out.

Both Trump and Sanders are headed into friendly territory.

The race now shifts to New Hampshire, which holds the nation’s first primary on Feb. 9. The electorate — both Republican and Democratic — is more moderate than in Iowa, one reason that more mainstream GOP contenders have already decamped there ahead of a snowstorm bearing down on the Midwest.

Even though Clinton won New Hampshire in 2008, Sanders has a natural advantage among the state’s independent voters thanks to his perch in next-door neighbor Vermont. And Trump has held a double-digit lead over his closest rivals for weeks in polls.

As he made his pitch to voters at a West Des Moines caucus site, Trump kept one eye on the next round of votes.

“We will go on to get the Republican nomination and we will go on to easily beat Hillary or Bernie or whoever else they throw up there,” Trump said.