EAST LANSING, Mich. (AP) — Payton Thorne threw two touchdown passes and ran for another to lead No. 12 Michigan State to a 30-27 victory over Penn State.

Kennett Walker III rushed for 138 yards and a touchdown on 30 carries as the Spartans bounced back from last week’s 56-7 loss to Ohio State.

Michigan State finished undefeated at home for the first time since 2015. Sean Clifford threw three touchdown passes, two to Jahan Dotson, for the Nittany Lions.

Penn State closed out the regular season with five losses in its last seven games.