In the Democratic primary contest, Bernie Sanders stunned front-runner Hillary Clinton in a narrow Michigan primary upset, giving his upstart campaign new energy. Clinton won in Mississippi, but Sanders' victory is seen as likely to ensure a prolonged fight to pick a candidate for November's general election.

Republican front-runner Donald Trump racked up primary wins in the big prize of Michigan and in Mississippi on Tuesday, brushing off a week of blistering attacks from the party's establishment and expanding his lead in the White House nominating race.

RELATED: If Bernie Sanders were a woman, he'd be unelectable

In the Democratic race, Sanders told reporters in Florida that the results in Michigan were a repudiation of the opinion polls and pundits who had written off his chances in the state. Polls had shown Clinton with a double-digit lead going into the primary.

The U.S. senator from Vermont, a democratic socialist, said the win showed his political revolution was "strong in every part of the country. Frankly, we believe our strongest areas are yet to come."

Clinton's campaign signaled ahead of Michigan that the race could be tight. Clinton, her husband, former President Bill Clinton, and daughter Chelsea Clinton all campaigned in the state over the past few days trying to garner last-minute votes.

RELATED: Sanders supporters' plan to win Clinton superdelegates may be backfiring

Trump's convincing win in Michigan restored his outsider campaign's momentum and increased the pressure on the party's anti-Trump forces to find a way to stop the brash billionaire's march to the nomination ahead of several key contests next week.

The 69-year-old New Yorker built his victories in Michigan, in the heart of the industrial Midwest, and Mississippi in the Deep South with broad appeal across many demographics. He won evangelical Christians, Republicans, independents, those who wanted an outsider and those who said they were angry about how the federal government is working, according to exit polls.

At a news conference afterward, Trump said he was drawing new voters to the Republican Party and the establishment figures who are resisting his campaign should save their money and focus on beating the Democrats in November.

RELATED: The secret behind Trump's speeches: Enthymemes

"I hope Republicans will embrace it," Trump said of his campaign. "We have something going that is so good, we should grab each other and unify the party."

The results were a setback for rival John Kasich, governor of Ohio, who had hoped to pull off a surprise win in neighboring Michigan, and Marco Rubio, a U.S. senator from Florida who has become the establishment favorite but lagged badly in both Michigan and Mississippi and appeared unlikely to win delegates in either.

Trump said Rubio's recent attacks on him had backfired.

"Hostility works for some people; it doesn't work for everyone," the real estate magnate said at a news conference in Jupiter, Florida.