Here are reactions from seven presidential candidates on the evening of the 2016 Iowa caucuses. (Sarah Parnass/The Washington Post)

After front-runners from both parties took hits in the Midwest, presidential contenders shifted strategies on Tuesday as they began a week-long sprint to next week’s New Hampshire primary.

Several GOP establishment candidates — who had paid less attention to Monday’s Iowa caucuses in order to focus on the Granite State — took aim at Sen. Marco Rubio (Fla.) after he made a strong third-place finish there. New York businessman Donald Trump, whose dominance of the Republican field faltered a bit after placing second to Sen. Ted Cruz (Tex.) in Iowa, sought to reassert his position in a state where he has consistently led in the polls.

On the Democratic side, former secretary of state Hillary Clinton narrowly slipped past surging rival Sen. Bernie Sanders (I-Vt.). Their contest has intensified after a virtual dead-heat finish in Iowa and the departure of former Maryland governor Martin O’Malley from the race.

With all precincts counted, the Iowa Democratic Party reported Clinton had 49.8 percent of the caucus vote to Sanders’s 49.6 percent and declared her the victor.

How rural voters controlled the Iowa caucuses

Politicians of both parties face a different set of voters and issues heading into the nation’s first primary: more moderate than Iowans in general and less attuned to religious-oriented appeals on the campaign trail.

Cruz made an appeal to voters in Windham, N.H., by invoking Ronald Reagan’s win here in 1980, saying, “The Granite State shocked the country” with that vote.

Iowa voters have just “sent notice across this country that this election is not going to be decided by the media,” he said. “That this election is not going to be decided by the lobbyists and the Washington cartel. That it’s going to be decided by the grass roots.”

But the senator is headed soon to South Carolina, a more conservative primary state, while most of the GOP candidates are focused on appealing to the party’s center. Under that calculus, Rubio has emerged as a key target.

New Jersey Gov. Chris Christie disparaged Rubio in sharply personal terms, suggesting he was running a “constantly scripted campaign” and lacked the grit and intelligence to withstand rigors of a more freewheeling presidential contest.

“Maybe he’ll do more than 40 minutes on a little stage telling everybody his canned speech that he’s memorized,” Christie told reporters. “This isn’t a student council election, everybody. This is an election for president of the United States. Let’s get the boy in the bubble out of the bubble, and let’s see him play for the next week in New Hampshire. I’m ready to play, and I hope he is.”

Ohio Gov. John Kasich mocked Rubio’s policy credentials in a conference call with reporters Tuesday. “President Obama had a similarly record-free political life before he became president,” he said. “If someone would let me know what Marco Rubio’s record is, we could compare it.”

Sen. Bernie Sanders speaks during a caucus night party in Des Moines on Monday. (Andrew Harrer/Bloomberg)

While personal attacks are nothing new to the 2016 race, the lines of argument have changed because New Hampshire’s voters reflect another side of the GOP. They are socially moderate and fiscally frugal and use a primary voting system that allows greater participation by independent-minded voters who revel in upsetting the conventional wisdom.

Wayne Lesperance, a professor of political science at New England College in Henniker, N.H., said that “New Hampshire has gone differently than Iowa in six of the last nine elections on the Republican side, so the idea that one follows the other’s lead just doesn’t bear out.”

It is one reason why Cruz faces a challenge in trying to replicate Monday’s victory in New Hampshire’s primary next week, with a less-robust organization in a state where has spent less time and cannot count on such a large evangelical electorate.

History provides a clear warning. In 2008 and 2012, former Arkansas governor Mike Huckabee and former senator Rick Santorum of Pennsylvania won the Iowa Republican caucuses with heavy support from evangelicals. Both then arrived in New Hampshire lacking a strong organization, lost the state and failed to become the GOP nominees.

And yet, Iowa and New Hampshire share more in common this cycle, thanks to Trump. He has held a double-digit lead over his GOP opponents here for more than 30 weeks and dominates the headlines — just as he did in Iowa before losing to Cruz there on Monday.

For now, Trump is favored by 38 percent of GOP primary voters in New Hampshire, according to a Boston Herald-Franklin Pierce University poll released Sunday. Cruz is a distant second at 13 percent, followed by Rubio and former Florida governor Jeb Bush, 10 percent; Kasich, 8 percent; and Christie, 5 percent.

A CNN-WMUR-TV poll released Sunday showed similar results: Trump with 30 percent, followed by Cruz, 12 percent; Rubio, 11 percent; Kasich, 9 percent; Christie, 8 percent; and Bush with 6 percent.

Bush, who held a campaign rally at Franklin Pierce University in Rindge, N.H., on Tuesday, questioned all of Iowa’s top three finishers. He questioned both Rubio and Cruz’s lack of “life experience,” asking, “Is there something you can look back on, whether it’s their business career or political career, that might have been against their own ambitions to achieve a public good?”

But Bush was even harsher in his assessment of Trump.

“We have Donald Trump, who is from the outside and he’s gifted beyond belief when he promotes himself.,” he said. “And when he insults others, he pushes people down. Whether you’re Hispanic or a woman or a veteran or a POW or a disabled person, he’s extraordinary at making fun of others to make himself look strong.”

Rubio, meanwhile, was already making the rounds in New Hampshire on Tuesday morning, doing a series of television interviews and preparing to meet voters.

“Well, I think people realize on the Republican side that we cannot afford, this country cannot afford to lose this election, and that I give the party the best chance not just to unify the conservative movement but to grow it,” he said on ABC’s “Good Morning America” from Manchester’s Airport Diner.

“To take our message to people who don’t vote Republican now, grow our party, grow our movement and defeat Hillary Clinton or Bernie Sanders,” he added.

Rubio, who picked up a key endorsement from GOP Sen. Tim Scott (S.C.) Tuesday, noted that Cruz built a formidable operation in Iowa. “He earned this victory, but we feel so good about the growth we’ve had and what that’s going to translate to now in New Hampshire, and after that, South Carolina.”

Working the crowd, the Florida senator boasted about the “massive” turnout in Iowa, where 187,000 voters, or 8 percent of the state electorate, came out to caucus for Republicans.

“I got more votes than Santorum did, than Romney did, than Huckabee did,” he said.

As one customer gave Rubio some cigars, he joked that he wanted to keep them under wraps — “I don’t want the kids to see” — but alluded to when he might smoke the stogies. “Maybe we’ll save them for Tuesday night,” he said, as his supporters in the diner cheered.

While Rubio placed a strong third in Iowa, the other establishment candidates trailed far behind. Bush earned 3 percent support, topping Christie and Kasich, who each received 2 percent.

In New Hampshire, Kasich held his 89th town hall meeting on Monday night. Christie has held 114 public events in the state since launching his campaign in June. Bush, who has most relentlessly attacked Trump as unqualified to be president, hosted his 80th public event in the state on Monday night.

David Price of Weare, N.H., attended Kasich’s event Sunday at the school and said he would take note of how Iowa voted. “But as a true New Hampshirite, I look at it independently,” he said.

Price called Kasich “a very personable individual” but added that right now “I’m leaning to . . . Jeb Bush.”

And while a poor performance in Iowa has already prompted Huckabee to drop out, other candidates at the back of the pack are forging ahead.

“We fight on!” Sen. Rand Paul (R-Ky.) tweeted after coming in fifth with roughly 5 percent of the vote in Iowa “We are not trading our liberty for anything,” he added in a separate tweet. “Not now, not never. Hell no.”

While the GOP field remains sprawling, the tiny Democratic one now pits the iconoclast Sanders against Clinton, the epitome of the Democratic establishment. In the early morning hours Tuesday, Clinton’s aides said they viewed Iowa as “tailor-made” for Sanders, and that despite his advantages with the state’s liberal Democratic base, he was unable to win.

“Sanders has been saying for several weeks that if this caucus was a high turnout affair, then he would win,” said Clinton campaign press secretary Brian Fallon, after arriving in Manchester. “He was wrong.”

Edison Media Research estimates that 171,109 voters, or 7 percent of the eligible voters statewide, turned out for Iowa’s Democratic caucuses. The turnout represents a decline from 10.7 percent in 2008, but an increase from 5.6 percent in 2004.

Sanders can now campaign in a state adjacent to the one he represents, giving him a home-court advantage and a comfortable lead in the polls. But Clinton can take some comfort in the fact that New Hampshire’s Democratic primary voters are less liberal than those who caucused for the party in Iowa. In addition, New Hampshire has demonstrated support for both her and her husband when they have suffered political setbacks in the past.

Sanders, for his part, was celebrating as he made his way to the back of his chartered jet at nearly 3 a.m. Tuesday. The senator told a crush of reporters in the aisle that his campaign is now “in this for the long haul.”

“We’re going to win states all over the country,” a beaming Sanders said. The result from Iowa was “a wonderful start off to the national campaign,” he added. “We’re in this to the convention, and this is a campaign that we can win.”

Abby Phillip, John Wagner and Sean Sullivan in Manchester, N.H., Philip Rucker in Bedford, N.H., Katie Zezima in Windham, N.H., Anne Gearan in Des Moines and Scott Clement in Washington contributed to this report.