Republican Donald Trump and Democrat Bernie Sanders upended the political establishment Tuesday in decisive victories in the New Hampshire primaries over mainstream adversaries. But both face challenges in continuing their momentum when the race shifts to terrain in the South that is more hospitable to their top rivals.

Trump, who led the Granite State’s polls for weeks, topped a crowded field of Republican candidates with a victory cementing his front-runner status ahead of the Feb. 20 GOP primary in South Carolina. The political newcomer’s first election victory helped him bounce back from a humbling defeat last week in Iowa.

Ohio Gov. John Kasich won the battle for second place, which pitted him against Florida U.S. Sen. Marco Rubio and two other governors who fought for the mantle of who could best unite the GOP. The muddled field competing for the title, though, virtually guarantees the race will drag on for weeks or even months.

Sanders, a U.S. senator from Vermont, has long held the upper hand over Hillary Clinton in the two-way Democratic contest for New Hampshire, enthralling crowds of younger voters with his embrace of liberal policy platforms. Clinton tried to cut into double-digit poll deficits by painting him as an idealist who risks undoing hallmark Democratic gains.

The state was a must-win for both Trump and Sanders as the race enters a new phase in the more diverse and populous South.

The heavily black Democratic electorate in South Carolina represents a challenge that Sanders didn’t face in New Hampshire and Iowa, where the voting base is overwhelmingly white. And the conservative and religious GOP bloc in South Carolina is comparable to the Republican electorate in Iowa that last week powered Texas U.S. Sen. Ted Cruz to victory past Trump.

Both of Tuesday’s winning candidates rode a populist wave of voter disgust with the establishment in Washington by promising to smash the status quo. And their victories were a repudiation of party leaders who have failed at every turn to thwart their campaigns.

Trump, a real estate mogul who wowed crowds with say-anything candor, used his victory speech to renew a vow to build a wall across the Mexican border and restore the nation’s international prestige.

“We are going to make America great again, and we’re going to do it in the old-fashioned way,” Trump said to a rowdy audience in Manchester.

Kasich depicted his surge to a second-place finish as a repudiation of negative politicking and an endorsement of his sunny message.

“We never went negative because we have more to sell than spending our time being critical,” he said. “Maybe, just maybe, we are turning the page on a dark part of American politics. Tonight the light overcame the darkness.”

Sanders invigorated huge audiences at college campuses across New Hampshire by railing against powerful business interests and calls for a “revolution” to expand the public health care system, provide tuition-free college education and boost infrastructure programs.

“It’s just too late for the same old, same old establishment politics and the establishment economics,” he said in a lengthy victory speech. “The people want real change.”

Clinton, meanwhile, is forced to grapple with an unexpectedly close Democratic race. Long the front-runner, the former secretary of state only narrowly defeated Sanders in the Iowa caucus, and now she has lost in New Hampshire, a state that granted her a victory in the 2008 primary against Barack Obama.

“People have every right to be angry. But they’re also hungry for solutions. And that is the fight we’re taking to the country,” she said, adding: “I promise I will work harder than everyone to actually make the changes that make your lives better.”

Her campaign expects to fare better in South Carolina, where Democrats vote Feb. 27, and in Georgia and the sweep of other states that cast ballots on March 1 in what’s become known as the SEC primary. Some polls show Sanders facing daunting deficits with black voters who dominate those contests.

GOP race remains unsettled

Republicans once hoped that New Hampshire voters would help narrow the field of candidates that survived last week's Iowa vote. And Rubio's surprisingly strong third-place finish in that contest helped him make the case that he's the Republican who can unite the party.

But his uneven performance in Saturday's debate in Manchester raised fresh doubts among some New Hampshire residents about his experience, while former Florida Gov. Jeb Bush and New Jersey Gov. Chris Christie tried to leverage his miscues to say he isn't ready for prime time. Rubio's support collapsed on Tuesday, leaving him in a duel with Bush for fourth place.

Christie fared worse than Rubio, and The Associated Press reported late Tuesday that the governor said that instead of campaigning Wednesday, he was returning to New Jersey “to take a deep breath” and take stock of his run for the White House.

Bush has emerged as the most outspoken critic of Trump, calling him a “loser” and a “liar” as he showed an edgier side at New Hampshire rallies. Christie took the offensive against Rubio, repeatedly questioning the first-term senator’s adherence to a “memorized 25-second speech” at the debate as a warning.

But it was Kasich’s embrace of an above-the-fray approach, which he displayed at more than 100 town hall meetings across the state, that helped him emerge as the runner-up. He sought at every turn to stress positives as a contrast to the mudslinging that shaped the rest of the election.

“You can’t get elected without carrying Ohio. And Kasich is the only one talking about conciliation, about getting along with folks — not that ‘my way or the highway’ stuff,” said Bill McCarthy, a Kasich supporter standing outside a snow-covered school in Concord. “I’m so disgusted with all that that I had to get out of my chair.”

The vote did nothing to bring clarity to the jumble of mainstream candidates at the middle of the polls, who all sniped at each other. Each vowed early Tuesday to stay in the race no matter the outcome, though the race was deeply in flux after the polls closed.

Cruz, meanwhile, campaigned in New Hampshire with one eye on the South. The Republican electorate here is much more independent-minded and moderate than the deeply conservative and religious GOP voting bloc that delivered him a victory in Iowa — and awaits him in South Carolina.

And two other outsiders, retired neurosurgeon Ben Carson and businesswoman Carly Fiorina, struggled to muster enough support to stay in the race at least until the primary in South Carolina. Carson, for one, announced plans to campaign this week in the South.

The results made one thing certain: Leaders in both parties are fast acknowledging that both contests won’t wrap up any time soon.