ANN ARBOR, Mich. -- Michigan (No. 23 AP) 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 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.