The race was called by the Associated Press and Fox News just after 11:30 p.m. ET.
With 31% of the precincts reporting as of 9:10 p.m. ET, Sanders led Clinton 50.9% to 47.1%. That lead weakened once precincts in heavily-black areas of Detroit began to report, with Clinton winning nearly 60% of the vote. But his lead steadied again, with Sanders at 50.6% and Clinton at 47.5% after 71% of the precincts had been counted. And then, later, at 50.4% for Sanders and 47.6% for Clinton with 92% of the precincts counted.
Faces at Clintons victory rally looked troubled, with supporters apparently watching the returns as she spoke.
Meanwhile, Sanders pulled together an impromptu press briefing in Miami, thanking the people of Michigan. It was the understatement of the night and could represent a turning point in the Democratic primary contest.
The last two public polls released before the election showed Clinton ahead by margins of 37% and 27%. The RealClearPolitics average of polls had Clinton ahead by 21.4%. Only one poll out of dozens had shown Sanders within single digits of Clinton in Michigan, and that poll, an outlier, was taken six months ago, in September.
Nate Silver of fivethirtyeight.com called it among the greatest polling errors in primary history. But polling over several months that shows the same result cannot be called an error. The voters simply changed their minds.
Clinton is still, by far, the favorite to win the nomination. She enjoys a wide lead in delegates and a massive lead in superdelegates, adding to her lead by trouncing Sanders in Mississippi, 82.9% to 16.2%.
Still, with his historic victory in Michigan, Sanders showed that he does not intend to go quietly.