Bernie Sanders pulled off an upset win over rival Hillary Clinton in Michigan's Democratic primary.

Polls going into Tuesday indicated that Clinton had a double-digit lead over Sanders -- so much for the polls.

Sanders took 49.9% of the vote. Clinton took 48.2%.

Delegates in Michigan are split proportionally. With the win, Sanders picked up 65 delegates, and Clinton, picked up 58 delegates.

The win adds new momentum to the Sanders campaign, which lags Clinton in the delegate count.

(The New York Times has good display of full election results here.)

Clinton still has a strong lead -- especially with her primary win in Mississippi tonight -- but tonight's win in Michigan sets up Sanders up for next Tuesday’s big primary voting in Illinois, Ohio, Missouri, North Carolina, and Florida.

The eventual Democratic nominee needs 2,383 delegates to win the nomination. After the most recent primaries, Sanders has 546 delegates to Clinton’s 760.

“This has been a fantastic night in Michigan,” Sanders said. He said he expects the campaign to do well in the primaries next week and in states in the West.

In a debate in Flint on Sunday, Sanders pressed hard on his message that unfair trade deals have left American workers without good-paying jobs – and that an economic recovery has benefited mostly wealthier Americans. His message likely resonated in a state that has seen some of the worst job losses over the last decade.

Starting in 2000, the labor force in Michigan began to plummet – well ahead of the Great Recession in 2008. The state has seen modest gains in job growth in recent years.

More analysis from NPR:

In exit polls, the majority of Michigan voters (58 percent) said they think trade takes away U.S. jobs, and Sanders was strong among those voters, with 56 percent of their vote. With another big-delegate Rust Belt state (Ohio) coming up next week, expect to see the Sanders camp amplify the trade message.

If you count all the Democratic delegates available tonight, Clinton came out ahead because of her big win in Mississippi. She won that state with 83% of the vote.

*This post was last updated on March 9 at 7:03 a.m.