No. 23 Michigan tops Michigan State 12-10 on GW FGMichigan State safety RJ Williamson, left, and linebacker Denicos Allen (28) stop Michigan wide receiver Drew Dileo (9) during the second quarter of an NCAA college football game in Ann Arbor, Mich., Saturday, Oct. 20, 2012. (AP Photo/Carlos Osorio)
ANN ARBOR, Mich. (AP) -- Michigan and Michigan State play for one of the uglier trophies in sports, a 4-foot high Paul Bunyan.
The Wolverines, though, couldn't have been happier to finally welcome back the battered wooden lumberjack statue.
Brendan Gibbons made a 38-yard field goal with 5 seconds left, lifting No. 23 Michigan to a 12-10 win over Michigan State on Saturday.
The Wolverines (5-2, 3-0 Big Ten) beat the Spartans for the first time since 2007 to avoid a school-record, five-game losing streak in the series.
And, to let Bunyan stay in Ann Arbor.
''Paul's back,'' safety Jordan Kovacs said. ''He's in the locker room.''
The Spartans (4-4, 1-3) had a chance to retain the hardware - retaking the lead on Dan Conroy's 19-yard field goal with 5:48 left after a fake punt kept the possession alive - but they couldn't run out the clock on their last drive or make a second straight stop on defense.
Denard Robinson threw a 20-yard pass to Drew Dileo to set up the game-winning kick and then couldn't watch when Gibbons lined up for the kick.
''I just took a knee and prayed,'' Robinson said.
It was the 900th win for Michigan, college football's winningest program.
''That wasn't the focus for the week,'' Hoke said. ''It was playing a great rivalry game, a game in our division that was important to win.''
The victory was one perhaps the sweetest - rivaling the one over Virginia Tech in the Sugar Bowl - for the Wolverines since they snapped a school-record, seven-game skid against Ohio State last season.
''This program was in desperate need for a win in this game,'' Kovacs acknowledged.
Michigan's players sprinted toward the student section to celebrate after the win, and the fans in turn, spilled out onto the field, covering so much of it that Michigan State's marching band walked off the field without playing a note of its planned postgame performance.
''It was a tough game, a classic game,'' Spartans coach Mark Dantonio said. ''I'm proud of our team. I can live with it. I don't like it, but it's all you can ask sometimes.''
Robinson, who had been shut down in his two previous starts against the Spartans, made just enough plays with his feet and right arm to help Michigan win in the senior's final game of the rivalry.
''I'm glad he's gone,'' Dantonio said with a smile.
Robinson was 14 of 29 for 163 yards with an interception, a harmless turnover on an up-for-grabs pass at the end of the first half, and ran for 96 yards on 20 carries.
Dileo was his top target, catching four passes for 92 yards to set up scores on a day in which the defenses for both teams were dominant, and the junior receiver was also the holder on all four field goals.
Michigan State's much-maligned quarterback, Andrew Maxwell, played relatively well, but threw an interception to Kovacs that helped the Wolverines take a 9-7 lead early in the fourth.
Maxwell was 21 of 34 for 192 yards with a 2-yard TD toss to Paul Lang that put the Spartans up 7-6 midway through the third quarter. Those were the first points Michigan gave up in six quarters and the first TD in eight quarters.
Le'Veon Bell, who was averaging 131 yards rushing a game, had just 68 yards rushing on 26 carries and gained no more than 8 yards on any attempts against a defense designed to stop him.
Dantonio, who called a fake field goal in overtime to beat Notre Dame two years ago, pulled another play out of his bag of tricks at the right time.
The Wolverines were completely fooled when punter Mike Sadler took a snap from the Michigan State 23 on a fourth-and-9 and ran to the right, all alone, on a 26-yard gain that set up a go-ahead field goal.
''Special teams plays are momentum-changers,'' Sadler said.
That play, though, was not enough to beat Michigan, which led 6-0 at halftime.
In the first half, Robinson was held to just 17 yards rushing on 12 carries, and his longest went for 5 yards. Robinson connected on 22- and 15-yard passes to Dileo to set up Gibbons' 24-yard field goal early in the second quarter and a 35-yarder to Dileo that led to Matt Wile's 48-yard kick late in the first half.
Maxwell threw a 45-yard pass to Bennie Fowler to get into position to kick a game-tying field goal midway through the second half, but Conroy missed his sixth field goal of the season - from 38 yards - to match his number of misses from all of last year.
The Spartans had a chance to add to their lead late in the third, but Maxwell overthrew an intended receiver and safety Kovacs took advantage with a key interception.
Michigan settled for a 9-7 lead early in the fourth quarter after missing chances to score a TD.
The Wolverines, though, didn't miss on their opportunity to win a game they - and their fans - really wanted against a team they've had their way with most of the time for more than 100 years.
''At the end of the day, we did enough to win,'' Kovacs said.
Follow Larry Lage on Twitter at www.Twitter.com/larrylage