By Lewis Gould

Matt Coghlin kicked a 34-yard field goal as time expired — seven hours after the game began — and No. 24 Michigan State upset No. 7 Penn State 27-24.

The game was delayed nearly 3 1/2 hours by severe weather in the second quarter.

“We’ve put ourselves in position to at least be called a contender — and that’s what we want to do,” Michigan State coach Mark Dantonio said.

Penn State, meanwhile, failed to capitalize on Ohio State’s loss to Iowa.

The Nittany Lions lost 39-38 to the Buckeyes last weekend. A victory over Michigan State might have put Penn State (7-2, 4-2, No. 7) right back in the hunt for college football’s playoff, but instead, the Nittany Lions’ national title hopes may have crumbled for good.

Trace McSorley threw for 381 yards and three touchdowns for Penn State, but star Saquon Barkley was held in check. He had 0 yards rushing in the first half and finished with only 63. McSorley was intercepted three times.

“I think there’s a lot of noise that we try to manage. When things are going well there’s a lot of noise, a lot of positivity, a lot of patting on the back,” Nittany Lions coach James Franklin said. “When you lose the game it’s the complete opposite. It couldn’t be more negative. For us in the past we haven’t worried about all those things. There’s playoff rankings coming out. There’s this, there’s that. Stuff that doesn’t matter. … I would describe us as a young program. We haven’t been a part of these conversations for a long time. We haven’t handled it well. And that’s on me.”

Brian Lewerke threw for 400 yards and two touchdowns for the Spartans, and Michigan State was aided at the end by a roughing the passer call on Penn State’s Marcus Allen. Lewerke was hit by Allen on a third-down pass that fell incomplete in the final minute. The penalty moved the ball to the Penn State 22, and the Spartans were able to run the clock down before Coghlin’s winning kick.

Coghlin rebounded after missing two field goals in a triple-overtime loss at Northwestern last weekend.

Penn State was ahead 14-7 in the second quarter when the game was halted for a lengthy weather delay . The game kicked off at 12:05 p.m. and didn’t end until after dark at 7:03.