EAST LANSING (AP) – This was a thrilling finish Mark Dantonio could really enjoy.

Keith Nichol’s 44-yard touchdown catch on the last play of the game – after a heave by Kirk Cousins and a bounce off a Michigan State teammate – gave the Spartans a 37-31 victory over Wisconsin on Saturday night.

READ MORE: CDC: New Listeria Outbreak Tied To 23 Illnesses, 1 Death

The tiebreaking touchdown was the most memorable play at Michigan State at least since last year’s fake field goal in overtime beat Notre Dame at the same end of the field.

Following that game, Dantonio felt ill and was soon on his way to the hospital because of a mild heart attack. He recovered from that, and the team didn’t miss a beat.

Still hasn’t, actually.

“We are trying to build a program,” Dantonio said. “We’ve won 17 out of our last 20 games. We are just going to keep competing, and good things can happen for us.”

That was as good a way as any to describe Michigan State’s victory Saturday in a wild game in which both teams blew two-touchdown leads.

With 4 seconds left, Cousins rolled out to his right and threw the ball about as far as he could. It went into the end zone but caromed off Michigan State receiver B.J. Cunningham’s facemask back to Nichol, who caught it just outside the end zone, then fought two Wisconsin defenders and just barely broke the goal line.

The former backup quarterback was initially ruled short of the end zone, but officials overturned the call after a review, giving the Spartans (6-1, 3-0 Big Ten) the win and knocking the Badgers (6-1, 2-1) from the ranks of the unbeaten.

“It will obviously go down as one of my top plays that I have been a part of here at Michigan State and it will go down as one of the top plays at Michigan State in general,” offensive lineman Joel Foreman said. “We practice the tip drill all the time. It is kind of funny that it is the last thing we do on Thursdays, which is our last practice day. Last thing we do is do that and do the tip drill in the end zone.”

READ MORE: Red Wings Hire Lightning Assistant Derek Lalonde As Coach

Michigan State moved up six spots to No. 9 in the AP poll Sunday. Wisconsin dropped eight spots to No. 12.

The win left Michigan State one victory from a surprising October sweep. The Spartans lost at Notre Dame last month and appeared to have significant problems on the offensive line, but they’ve found their footing in conference play, beating Ohio State, Michigan and Wisconsin this month. They play at Nebraska next weekend.

The Badgers, meanwhile, play at Ohio State next weekend. They could see the Spartans again if the teams both reach the Big Ten title game.

“I’m around these kids every day,” Wisconsin coach Bret Bielema said. “Going back to January when we started working, I know these kids are tremendous characters with great attitudes and energy. This will sting and they will carry this memory with them for the rest of their life – and it’s going to be difficult. But as coaches, we have to pick up the pieces and move forward.”

Russell Wilson had led the Badgers from 14 points down in the fourth quarter to tie the game with 1:26 left on a 2-yard touchdown pass to Montee Ball.

Michigan State then survived a harrowing moment when Cousins fumbled deep in his own territory. Offensive lineman Dan France fell on the ball with 42 seconds left.

At that point, Wisconsin was eager to use timeouts, trying to get the ball back, but on second-and-20 from his own 24, Cousins found Cunningham for a 12-yard gain. The Spartans then picked up a first down on an 11-yard shovel pass to Keshawn Martin.

“If we get the ball back with less than 30 seconds we were going to go for a block (punt),” Wisconsin coach Bret Bielema said. “We were going for the win.”

Michigan State’s last drive appeared to stall at the Wisconsin 44, but the Spartans had time for one more play.

MORE NEWS: Troubling Arsenic Levels Found At Some Detroit Demolition Sites

(Copyright 2011 by The Associated Press.  All Rights Reserved.)