Spectators were scattering toward the exits of Spartan Stadium while officials were ordering the teams to head for the locker rooms when a thunderstorm that was coupled with a spectacular lightning show blew in during Saturday's game.

It happened to be the most important game of the season to date for Michigan State, and as a senior captain, Chris Frey knew that he had to make sure that his teammates would return to the field with the same intensity when the game against Penn State resumed.

What transpired will go down in the program's history: The Spartans got a 34-yard field goal from Matt Coghlin as time ran out for a 27-24 victory that bumped them to 12th in this week's playoff rankings.

Kickoff was at noon, but the game finished under the lights at 7:03 p.m. The delay lasted 3 hours, 22 minutes.

“You take a deep breath and relax — you stay in the moment and keep your mind in the game,” said Frey, a linebacker from Upper Arlington. “You tell yourself and the guys that our time is coming and that we will play this game and that we will win it. It got to 4 o’clock and then 5:30, and we’re still not playing. Then we’re eating, and they tell us we’ve got 30 minutes to play.”

Many players had taken off their uniforms; some even took showers. Frey told teammates to avoid sitting around and getting stagnant.

The victory was more evidence that Michigan State (7-2), which plays Ohio State (7-2) at Ohio Stadium on Saturday for possession of first place in the Big Ten East, is getting back on its feet after a disastrous 2016 season.

The Spartans not only finished 3-9 after winning the conference championship in 2015 and 2013, but they also had a string of embarrassing incidents. Three players were dismissed from the team after being charged with sexual assault, one player quit after making insensitive comments about a teammate, one spit in the face of an East Lansing parking and code-enforcement officer, and another was charged with armed burglary.

“The end of the season was different than in the past, and guys stepped up,” Frey said. “Our last game was against Penn State (a 45-12 loss), and Monday morning at 6 o’clock, we were back at it training. Our offseason training completely changed. We took it up another notch. The guys who were going to be leaders took over.”

Frey, who is in his second season as a starter, was one of the players taking charge.

The Spartans began to regain their balance with a 14-10 victory against Michigan in Ann Arbor in their fifth game.

“That was a big game, and that’s why you come to Michigan State,” Frey said. “Guys were ticked off and ready to go. We felt we were disrespected and wanted to get the pads on and go at it. We wanted that Paul Bunyan trophy back.”

The close Michigan game is typical for the Spartans: Five of their seven victories have been by a total of 25 points.

On Saturday, Frey will be wearing No. 23 and heavy eye-black as if he were a warrior. He has been just that on the field, with 34 tackles, 3½ sacks and two fumble recoveries. Last season, he led the team in tackles with 96.

“That’s who I am — that’s the love of the game and my enthusiasm,” he said. “You don’t get many opportunities to play this game, and you leave it all on the field. I’ve loved every second of being at Michigan State. It has been the best decision of my life. Every day being around Spartan Nation is a blessing.”