No. 8-rated Ohio State entered the contest as a 12.5-point favorite.
The game concluded the 2017 regular season for both schools.
Michigan now leads the series 58-49-6 all-time since the first encounter between the two back in 1897.
On Saturday, a big pregame question was answered when the Wolverines started senior John O'Korn at quarterback. Freshman Brandon Peters and senior Wilton Speight were not in uniform due to injuries.
After the two teams traded possessions, Michigan struck first on a 2-yard touchdown run by fullback Khalid Hill for a 7-0 lead with 6:02 to go in the opener. That score stood until the initial break.
After a 42-yard punt return by Donovan Peoples-Jones, the Wolverines came right back on the very first play of the second stanza. Michigan scored on a 3-yard scoring strike from O'Korn to tight end Sean McKeon for a 14-0 advantage with 14:57 showing on the clock.
Ohio State finally got on the scoreboard when quarterback J.T. Barrett scampered 21 yards down the right sideline for a TD to trim the gap to 14-7 with 9:50 left in the second period.
The Buckeyes then quickly knotted the score at 14-all when Barrett hit tight end Marcus Baugh with a 25-yard touchdown pass up the middle at the 5:54 juncture of the second quarter. That deadlock held up until intermission.
Michigan retook control midway through the third frame on a 2-yard touchdown run by Karan Higdon. The extra-point kick was blocked, giving the Wolverines a 20-14 edge with 7:07 to go in the third.
Just a moment later, with 6:07 showing on the clock, Barrett left the game and went to the locker room with a leg injury, as backup signal-caller Haskins, a freshman, came on for the Buckeyes. He immediately went to work and drove Ohio State downfield to its first lead at 21-20 on a J.K. Dobbins 1-yard TD run with 1:34 remaining in the third period.
The Buckeyes remained up 21-20 at the end of the third quarter.
They upped the margin to 24-20 on Sean Nuernberger's 44-yard field goal with 10:21 left in the game. Nuernberger than missed from that same distance at the 2:47 mark.
With time winding down, Haskins drove Ohio State again and Mike Weber Jr. of Detroit, a product of Cass Tech, scored on a 25-yard run for a 31-20 lead with 1:44 to play.
That advantage stood until the final gun sounded.
Michigan is now 8-4 entering a bowl game selection that has yet to be decided.
Ohio State now stands 10-2 going into next Saturday's Big Ten championship match-up with Wisconsin in Indianapolis, followed by the Buckeyes' bowl game, which also will be announced at a later time.