ANN ARBOR, Mich. -- 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 (4-4, 1-3) for the first time since 2007 to avoid a school-record, five-game losing streak in the series.

Denard Robinson threw a 20-yard pass to Drew Dileo to set up the game-winning kick.

Michigan State's Dan Conroy made a go-ahead field goal with 5:48 left after a fake punt kept the drive alive. The Spartans forced the Wolverines to punt from midfield after going ahead, but couldn't stop them when it mattered most in the final minute.

It was the 900th win for Michigan, college football's winningest program.

This one was the sweetest for the Wolverines since they snapped a school-record, seven-game skid against Ohio State last season.

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.

Robinson, who had been shut down in his two previous starts against the Spartans, made just enough plays to help Michigan win.

He 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.

Michigan State's much-maligned quarterback, Andrew Maxwell, played relatively well, but he threw an interception to Jordan Kovacs that helped the Wolverines take a 9-7 lead early in the fourth quarter.

Maxwell was 21 of 34 for 192 yards with a TD – a 2-yard toss to Paul Lang – that put the Spartans ahead 7-6 midway through the third quarter. Those were the first points Michigan's improving defense 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.

Michigan State coach Mark 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.

That play, though, was not enough to beat Michigan.

The Wolverines 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.

He was 8 of 13 for 108 yards in the first half, connecting on a 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 Gibbons' 48-yard kick late in the first half.

Behind an already banged-up offensive line that lost left tackle Dan France to a concussion in practice this week, the Spartans were sluggish with the ball in the first half as they have been often this season.

Bell ran for just 31 yards on 11 carries and Maxwell was 10 of 16 for 96 yards 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.

The Spartans started to click on offense on their first possession of the second half, picking up four first downs – matching their total from the first half – on four straight plays and a broken trick play set up the game's first TD.

Michigan State wide receiver Tony Lippett got the ball on a reverse that was designed for him to pass and he ended up keeping the ball, eluding three defenders that could've dropped him for a loss, for a 10-yard run that set up Maxwell's TD pass to Lang.

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 then had two chances to score a go-ahead TD, but safety Isaiah Lewis broke up a pass in the end zone intended for Devin Funchess and Robinson missed wide-open teammate Jeremy Gallon and the Wolverines had to settle for a FG and a 9-7 lead early in the fourth quarter.

The Wolverines, though, didn't miss on their opportunity to win a game they – and their fans – desperately wanted against a team they've had their way with most of the time for more than 100 years.

Loading Slideshow...
  • Braxton Miller

    Ohio State quarterback Braxton Miller lies injured on the ground after being tackled by a Purdue player during the third quarter of an NCAA college football game on Saturday, Oct. 20, 2012, in Columbus, Ohio. Ohio State defeated Purdue 29-22 in overtime. (AP Photo/Jay LaPrete)

  • Rushel Shell, Adam Redden, Drek Brim

    Pittsburgh's Rushel Shell (4) breaks away from Buffalo's Adam Redden (29) and Derek Brim (15) to score a touchdown during the first half of an NCAA college football game in Amherst, N.Y., Saturday, Oct. 20, 2012. (AP Photo/Bill Wippert)

  • Eric Ward, Kevin White

    Texas Tech wide receiver Eric Ward catches a touchdown pass against TCU cornerback Kevin White (25) during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Fort Worth, Texas. (AP Photo/LM Otero)

  • Ibraheim Campbell, Jamal Turner

    Northwestern defensive back Ibraheim Campbell (24) breaks up a pass intended for Nebraska wide receiver Jamal Turner (10) in the end zone during the first half of an NCAA college football game on Saturday, Oct. 20, 2012, in Evanston, Ill. (AP Photo/Charles Rex Arbogast)

  • Jelani Jenkins, Kenny Miles

    Florida linebacker Jelani Jenkins (3) goes airborne after assisting on a tackle on South Carolina's Kenny Miles (31) during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Gainesville, Fla. (AP Photo/John Raoux)

  • Perry Hills, Dontae Johnson, Brandon Pittman

    Maryland quarterback Perry Hills (11) looks to pass against North Carolina State safety Dontae Johnson (25) and linebacker Brandon Pittman, back left, during the first half of an NCAA football game, Saturday, Oct. 20, 2012, in College Park, Md. (AP Photo/Nick Wass)

  • Andrew Maxwell, Jake Ryan

    Michigan State quarterback Andrew Maxwell (10) is sacked by Michigan linebacker Jake Ryan (47) during the second quarter of an NCAA college football game, Saturday, Oct. 20, 2012, in Ann Arbor, Mich. (AP Photo/Tony Ding)

  • Chris Johnson, Justice Cunningham

    Florida's Chris Johnson, left, runs the ball to the 1-yard line in front of South Carolina's Justice Cunningham, right, after recovering a fumble on a kickoff during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Gainesville, Fla. (AP Photo/John Raoux)

  • Jeremy Reeves, Durrell Givens, Joseph Randle

    Iowa State defensive back Jeremy Reeves (5) watches as teammate and and fellow back Durrell Givens (24) leaps on to the back of Oklahoma State running back Joseph Randle (1) during the second half of an NCAA college football game in Stillwater, Okla., Saturday, Oct. 20, 2012. Randle ran for two touchdowns and 150 yards in Oklahoma State's 31-10 win. (AP Photo/Brody Schmidt)

  • Jeff Greene, Sean Sylvia

    A pass intended for Georgia Tech wide receiver Jeff Greene, right, is broken up by Boston College defensive back Sean Sylvia during the second quarter of an NCAA college football game, Saturday, Oct. 20, 2012, in Atlanta. (AP Photo/David Goldman)

  • Jerrell Gavins, Eric Johnson

    Boise State's Jerrell Gavins (4) makes an interception in the end zone against UNLV's Eric Johnson (9) during the first half of an NCAA college football game Saturday, Oct. 20, 2012, in Boise, Idaho. (AP Photo/Matt Cilley)

  • Quinton Dunbar, Jimmy Legree

    Florida's Quinton Dunbar (1) breaks away from South Carolina cornerback Jimmy Legree (15) on a 13-yard touchdown pass play during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Gainesville, Fla. (AP Photo/John Raoux)

  • Stanford tight end Zach Ertz, center, runs in into the end zone past California defensive back Josh Hill (23) on a 20-yard touchdown catch during the first half of an NCAA college football game in Berkeley, Calif., Saturday, Oct. 20, 2012. (AP Photo/Marcio Jose Sanchez)

  • Zeke Motta, Ross Apo

    Brigham Young wide receiver Ross Apo (1) is knocked out of bounds at the 2-yard line by Notre Dame safety Zeke Motta during the first half of an NCAA college football game in South Bend, Ind., Saturday, Oct. 20, 2012. (AP Photo/Michael Conroy)

  • Trevone Boykin

    TCU quarterback Trevone Boykin (2) passes during the first half of an NCAA college football game against Texas Tech, Saturday, Oct. 20, 2012, in Fort Worth, Texas. (AP Photo/LM Otero)

  • Seth Doege, Alfredo Morales, Chucky Hunter

    Texas Tech quarterback Seth Doege (7) passes as teammate Alfredo Morales (56) blocks TCU defensive tackle Chucky Hunter (96) during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Fort Worth, Texas. (AP Photo/LM Otero)

  • Darrin Moore, Kevin White

    Texas Tech wide receiver Darrin Moore (14) pulls in a touchdown pass against TCU cornerback Kevin White (25) during the first half of an NCAA college football game, Saturday, Oct. 20, 2012, in Fort Worth, Texas. (AP Photo/LM Otero)

  • Kyle Flood, Norries Wilson

    Rutgers head coach Kyle Flood, right, congratulates running backs coach Norries Wilson, left, late in the second half of an NCAA college football game against Temple, Saturday, Oct. 20, 2012, in Philadelphia. Rutgers won 35-10. (AP Photo/Mel Evans)

  • Taylor Martinez, Chi Chi Ariguzo

    Nebraska quarterback Taylor Martinez (3) escapes a safety by Northwestern linebacker Chi Chi Ariguzo (44) with an incomplete shovel pass during the first half of an NCAA college football game on Saturday, Oct. 20, 2012, in Evanston, Ill. (AP Photo/Charles Rex Arbogast)

  • Levine Toilolo, Michael Lowe

    Stanford tight end Levine Toilolo, top, catches a nine-yard touchdown pass in front of California defensive back Michael Lowe during the first half of an NCAA college football game in Berkeley, Calif., Saturday, Oct. 20, 2012. (AP Photo/Marcio Jose Sanchez)

  • Stanford running back Stepfan Taylor (33) runs against California during the first half of an NCAA college football game in Berkeley, Calif., Saturday, Oct. 20, 2012. (AP Photo/Marcio Jose Sanchez)

  • Matthias Farley, Sheldon Day, Jamaal Williams

    BYU running back Jamaal Williams (21) is knocked out-of-bounds after a 21-yard gain by Notre Dame safety Matthias Farley, right, and defensive end Sheldon Day during the first half of an NCAA college football game in South Bend, Ind., Saturday, Oct. 20, 2012. (AP Photo/Michael Conroy)

  • Thomas Gordon, Bennis Fowler

    Michigan State wide receiver Bennie Fowler is upended by Michigan safety Thomas Gordon (30) after a 45-yard pass reception during the second quarter of an NCAA college football game at Michigan Stadium, Saturday, Oct. 20, 2012, in Ann Arbor, Mich. (AP Photo/Carlos Osorio)

  • Jace Davis, Donovan Henley

    Northern Colorado wide receiver Jace Davis, left, pulls in a pass for a touchdown in front of Idaho State cornerback Donovan Henley during the first quarter of an NCAA college football game on Saturday, Oct. 20, 2012, in Greeley, Colo. (AP Photo/David Zalubowski)

  • Savon Huggins, Chris Hutton

    Rutgers running back Savon Huggins (28) runs with the ball as Temple defensive back Chris Hutton (28) tries to make a tackle during the second half of an NCAA college football game Saturday, Oct. 20, 2012, in Philadelphia. Rutgers won 35-10. (AP Photo/Mel Evans)

  • Denard Robinson

    Michigan quarterback Denard Robinson (16) throws during the second quarter of an NCAA college football game against Michigan State at Michigan Stadium, Saturday, Oct. 20, 2012, in Ann Arbor, Mich. (AP Photo/Carlos Osorio)

  • J.W. Walsh, Daniel Koenig

    Oklahoma State quarterback J.W. Walsh, left, celebrates his touchdown with lineman Daniel Koenig, right, during the second half of an NCAA college football game against Iowa State in Stillwater, Okla., Saturday, Oct. 20, 2012. Oklahoma State won 31-10. (AP Photo/Brody Schmidt)

  • Clint Moseley

    Auburn quarterback Clint Moseley (15) throws a pass against Vanderbilt in the third quarter of an NCAA college football game on Saturday, Oct. 20, 2012, in Nashville, Tenn. (AP Photo/Joe Howell)

  • James White, Montee Ball

    Wisconsin's James White (20) and Montee Ball celebrate Ball's touchdown during the second half of an NCAA college football game against Minnesota Saturday, Oct. 20, 2012, in Madison, Wis. White had 3 touchdowns and Ball had 2 touchdowns in Wisconsin's 38-13 win. (AP Photo/Andy Manis)

  • WILLIAMS

    Texas A&M running back Trey Williams (20) runs 76-yards after receiving a kickoff against LSU during the second half of an NCAA college football game, Saturday, Oct. 20, 2012, in College Station, Texas. LSU won 24-19. (AP Photo/Eric Kayne)

  • Ryan Groy, Kyle Costigan, James White

    Wisconsin's Ryan Groy, left, and Kyle Costigan celebrate with James White after White's 34-yard touchdown run against Minnesota during the first half of an NCAA college football game Saturday, Oct. 20, 2012, in Madison, Wis. White had 3 touchdown and 175 yards rushing in Wisconsin's 38-13 win. (AP Photo/Andy Manis)

  • WILLIAMS

    Texas A&M running back Trey Williams (20) runs 76-yards after receiving a kickoff against LSU during the second half of an NCAA college football game, Saturday, Oct. 20, 2012, in College Station, Texas. LSU won 24-19. (AP Photo/Eric Kayne)

  • Texas A&M quarterback Johnny Manziel (2) throws against LSU during the second half of an NCAA college football game, Saturday, Oct. 20, 2012, in College Station, Texas. LSU won 24-19. (AP Photo/Eric Kayne)

  • Jerry Kill

    Minnesota coach Jerry Kill disputes a call during the first half of an NCAA college football game against Wisconsin, Saturday, Oct. 20, 2012, in Madison, Wis. Wisconsin won 38-13. (AP Photo/Andy Manis)

  • Bret Bielema

    Wisconsin coach Bret Bielema embraces Montee Ball after he scored a touchdown during the second half of an NCAA college football game against Minnesota, Saturday, Oct. 20, 2012, in Madison, Wis. Wisconsin won 38-13. (AP Photo/Andy Manis)

  • D.C. Jefferson

    Rutgers tight end D.C. Jefferson (10) catches a pass for a touchdown during the second half of an NCAA college football game against Temple, Saturday, Oct. 20, 2012, in Philadelphia. Rutgers won 35-10. (AP Photo/Mel Evans)

  • Jeff Heuerman

    Ohio State tight end Jeff Heuerman celebrates his two-point conversion late in the fourth quarter of an NCAA college football game against Purdue, Saturday, Oct. 20, 2012, in Columbus, Ohio. Ohio State 29-22 in overtime. (AP Photo/Jay LaPrete)

  • Kevin Johnson, Darius Jennings

    Wake Forest cornerback Kevin Johnson (9) is tackled by Virginia wide receiver Darius Jennings (6) after grabbing an interception during the second half of an NCAA college football game at Scott Stadium in Charlottesville, Va., Saturday, Oct. 20, 2012. Wake Forest won the game 16-10. (AP Photo/Steve Helber)

  • D.C. Jefferson

    Rutgers tight end D.C. Jefferson (10) is swarmed by Temple defenders during the second half of an NCAA college football game Saturday, Oct. 20, 2012, in Philadelphia. Rutgers won 35-10. (AP Photo/Mel Evans)

  • James Franklin

    Vanderbilt head coach James Franklin celebrates a 17-13 victory over Auburn with his daughter Shola Franklin, 5, following an NCAA college football game on Saturday, Oct. 20, 2012, in Nashville, Tenn. (AP Photo/Joe Howell)

  • D'Metrius Williams, John Pettigrew

    Bowling Green running back John Pettigrew carries the ball as Massachusetts defensive back D'Metrius Williams (13) defends in the third quarter of an NCAA college football game in Foxborough, Mass., Saturday, Oct. 20, 2012. Bowling Green won 24-0. (AP Photo/Michael Dwyer)

  • Travis Howard

    Ohio State cornerback Travis Howard celebrates their 29-22 overtime win over Purdue in an NCAA college football game Saturday, Oct. 20, 2012, in Columbus, Ohio. (AP Photo/Jay LaPrete)

  • Paul Freedman

    Virginia tight end Paul Freedman (88) hangs his head during the final moments of his teams 16-10 loss to Wake Forest in an NCAA college football game at Scott Stadium in Charlottesville, Va., Saturday, Oct. 20, 2012. (AP Photo/Steve Helber)

  • J.W. Walsh, Jansen Watson

    Oklahoma State quarterback J.W. Walsh, left, escapes from Iowa State defensive back, Jansen Watson, right, during the first half of an NCAA college football game in Stillwater, Okla. Saturday, Oct. 20, 2012. Walsh accounted for 46 yards rushing and one of the Oklahoma State touchdowns in the 31-10 win over Iowa State. (AP Photo/Brody Schmidt)

  • Durrell Givens, Jeremiah George, Jacques Washington, Josh Stewart

    Iowa State defenders Durrell Givens (24), Jeremiah George (52), and Jacques Washington (10), pressure Oklahoma State receiver, Josh Stewart (5), as he leaps out-of-bounds while attempting to score during the first half of an NCAA college football game in Stillwater, Okla. Saturday, Oct. 20, 2012. Oklahoma State won 31-10. (AP Photo/Brody Schmidt)

  • J.C. Coleman, Jonathan Meeks

    Clemson's Jonathan Meeks (5) scores a touchdown after making an interception as Virginia Tech's J.C. Coleman defends during the second quarter of an NCAA college football game on Saturday, Oct. 20, 2012, in Clemson, S.C. (AP Photo/Rainier Ehrhardt)

  • Florida fans with body paint spell out the name of Florida head coach Will Muschamp as they cheer during the first half of an NCAA college football game against South Carolina, Saturday, Oct. 20, 2012, in Gainesville, Fla. (AP Photo/John Raoux)

  • Marken Michel, BooBoo Gates

    Bowling Green defensive back BooBoo Gates (24) intercepts a pass intended for Massachusetts wide receiver Marken Michel (4) during the third quarter of an NCAA college football game in Foxborough, Mass., Saturday, Oct. 20, 2012. Bowling Green won 24-0. (AP Photo/Michael Dwyer)

  • Tajh Boyd

    Clemson quarterback Tajh Boyd, top, jumps over the line trying to score a touchdown against Virginia Tech during the second half of an NCAA college football game on Saturday, Oct. 20, 2012, in Clemson, S.C. Boyd did not score on the play. (AP Photo/Rainier Ehrhardt)