Hillary Clinton won the Mississippi Democratic primary early tonight, but in a surprise ending to the evening Bernie Sanders won Michigan - a state where the ex-secretary was up by double digits prior to today.

Clinton and her family campaigned in aggressively in the motor-based state this week, and the former U.S. senator accused Sanders of voting against an auto bailout that helped the state and she voted in favor of.

It wasn't enough to keep the Vermont senator at bay, however. He hit her again, and again, and again for backing trade deals he said contributed to Michigan's shattered economy.

With 99 per cent per cent of the vote counted, Sanders just squeaked home ahead of Clinton, winning 49.88 per cent to 48.22 per cent.

Sanders later he sent out a fundraising letter to his supporters calling it 'a major, game-changing victory' for his campaign.

Before the race could be called for her opponent, Clinton took the stage in Ohio. She ignored tonight's election results altogether and instead gave a Cleveland-oriented speech.

'If you work for me, if you vote for me, I will work my heart out for you,' she told her supporters gathered there. 'I will work every single day to make a difference in your lives.'

Scroll down for video

Your browser does not support the <code>iframe</code> HTML tag. Try viewing this in a modern browser like Chrome, Safari, Firefox or Internet Explorer 9 or later.

Your browser does not support the <code>iframe</code> HTML tag. Try viewing this in a modern browser like Chrome, Safari, Firefox or Internet Explorer 9 or later.

Hillary Clinton won the Mississippi Democratic primary early tonight, but in a surprise ending to the evening Bernie Sanders won Michigan - a state where the ex-secretary was up by double digits prior to today

Democratic Rep. Tulsi Gabbard of Hawaii joined Sanders at his Miami rally, where he spoke before he found out about Michigan

The Mississippi race, by comparison, was called for Clinton just minutes after polls closed at 8 pm.

Having already assumed a loss in the southern state, Senator Bernie Sanders was already on to the next and was rallying his supporters in Miami, Florida, as Clinton and her backers gathered in Cleveland.

He spoke of Michigan in the context of Flint, and the water crisis there and gave a fiery version of his stump speech, hitting Republican Donald Trump on his 'insults' of women and minorities and Clinton for accepting hundreds of thousands of dollars from Wall Street to speak at private functions.

Possibly expecting a loss in Michigan given Clinton's large lead in the polls there, he kept his focus on Florida - another state with a big, pledged delegate count.

Then, two hours later, with the vote still too close to call, he offered another statement, hailing an upset - and pointing out that the delegates will be split evenly between him and Clinton.

'It is not clear yet who will win this election here in Michigan,' he said - although he was speaking in Miami.

He said his message was one of thanks to the people of Michigan because 'you have repudiated the pundits who said that Bernie Sanders was not going anywhere'.

'In the last week we have won three caucuses and two of them were record-breaking turnouts,' he said.

'Whether we win or lose tonight in Michigan, basically the delegates are going to be split up because of proportional representation.'

He said the result showed that he could win anywhere.

'The political revolution that we are talking about is strong in every area of the country and frankly, we believe that the best is yet to come.'

Before the race could be called for her opponent, Clinton took the stage in Ohio - and ignored the election results all together

Despite the disappointing result in Michigan, Clinton seemed happy with the resounding victory in Mississippi

Clinton's supporters are seen celebrating the state Clinton did win outright - Mississippi - tonight in Ohio

The Mississippi race was called for Clinton just minutes after polls closed at 8 pm. She waited to speak, though, until the Michigan results came rolling in

Crushing: Early counting gave Clinton a huge victory over Sanders, although the night got worse for her later on with defeat in Michigan

Earlier he said spoke the Knight Center in downtown Miami.

'You are beautiful crowd. You are a loud crowd,' he said. 'I have the feeling you want to see this country move toward a political revolution!

As he closed, Sanders declared: 'A week from today, let's stand up for a political revolution. Let us be prepared to tell the billionaire class they cannot have it all. Come out and vote next Tuesday!'

Clinton won Mississippi with zero percent of precincts reporting as Sanders spoke. Early results put her on track to finish with an impressive 80 percent or more of the vote

The bulk of Mississippi's 36 Democratic delegates are expected to go to Clinton as a result of tonight’s outcome.

She was the expected winner, having outperformed Sanders in other southern states, mainly because of her popularity with African-Americans, and exit polling of the Magnolia State, where six in 10 Democratic voters were African American, suggested she’d have a repeat performance tonight.

ABC News reported this evening that black voter turnout was on track to break a record, and Clinton won nearly nine in 10.

Nearly half of Mississippi Democrats said they trusted ‘only’ Clinton to handle race relations in America. Just 11 percent said they ‘only’ wanted Sanders dealing with the issue. Another 35 percent said they’d be happy with both of them, while four percent said neither.

Another indicator of Clinton’s strength in the state: three quarters of Democratic voters said her proposals were realistic. Less than half had that view of Sanders’ to-do list.

The ex-cabinet secretary also did well on the honesty and trust question – three quarters gave her a good rating.

Lauren Esquivel said tonight at a rally in Miami that Bernie had her support, 100 percent

The bulk of Mississippi's 36 delegates are expected to go to Clinton tonight. She has outperformed Sanders in other southern states, mainly because of her popularity with African-Americans, and was the anticipated winner of tonight's primary in the Magnolia State

Strong start: Supporters react to positive primary results for Clinton before a rally at Cuyahoga Community College in Cleveland

Nearly half of Mississippi Democrats said they trusted ‘only’ Clinton to handle race relations in America. Just 11 percent said they ‘only’ wanted Sanders dealing with the issue. Another 35 percent said they’d be happy with both of them, while four percent said neither

Hillary Clinton and Donald Trump were likely to win their respective parties' contests today - but like Super Tuesday a week ago, it was a night that brought surprises, as Sanders surged ahead in Michigan. Voters are seen in Madison, Mississippi, earlier today

Starting them young: 21-month-old Karson Welch looks over the shoulder of her grandmother Kathy Gray as she votes in the primary at Pilgrim Rest M.B. Church precinct in Brandon, Miss

Michigan, where polls closed in parts of the state at 8 pm Eastern, and other parts at 9, was called for Sanders at the end of the night.

It became a battleground state for Clinton and Sanders, and both candidates campaigned there heavily over the past week.

With 130 delegates are at stake, Clinton was hoping to drive a dagger into Sanders' campaign by decimating him there.

Michigan was a critical test for for the senator, and one he could not afford to fail, forcing him to hit back hard at Clinton there on trade and her ties to Wall Street.

Exit polling suggests that he benefited from a strong turnout among white voters and independents. Seven in 10 voters there were white, compared to Mississippi, where they were the minority. A quarter of voters were independent.

Furthermore, Clinton performed worse in Michigan with black voters than she has in other states, winning two-thirds of them, compared to 80 percent and above in stand out contests.

The former secretary of state's integrity was called into question by a significant number of voters from her own party in Michigan - fewer than six in 10 said she was honesty and trustworthy.

Democratic voters meanwhile said 8-2 that Sanders could be trusted.

Their perceptions of the candidates' veracity and empathy played a fundamental role in their vote. A third said they wanted someone who 'cares about people like me.' Three in 10 said honesty was the deciding fact.

Sanders' performance in Michigan will propel him forward, on to next Tuesday, March 15, when four more states - Florida, Illinois, Ohio and Missouri - go to the polls.

Luckily for Clinton, the delegates from tonight's contests will be distributed proportionally, and she'll get nearly as many as Sanders.

She was an average of 21 points ahead in Michigan going into the election, but the Vermont senator kept his spirits high.