EAST LANSING, Mich. (AP)Quarterback Payton Thorne threw a 27-yard touchdown pass to wide receiver Jayden Reed in the second overtime Saturday to lift Michigan State to a 34-28 victory over Wisconsin.

The win snapped a four-game losing streak for the Spartans (3-4, 1-3 Big 10 Conference). It is the first loss for Wisconsin’s interim coach Jim Leonhard who replaced Paul Chryst two weeks ago.

The game-winning throw was set up after Michigan State’s Jacoby Windmon stripped the ball from Braelon Allen on the first play of the second overtime and defensive tackle Dashaun Mallory pounced on the ball. Three plays later, Thorne hit Reed in the right corner of the end zone with the game-winner.

”They had walked their (linebacker) up off the edge,” said Thorne who completed 21 of 28 passes for 265 yards. ”We really hadn’t seen that look all day. So I’m thinking he’s probably coming, and even if he’s bluffing, they might be bringing something from the other side which on the play we called it’s not great.”

Thorne continued: ”So I saw (Reed) was out there, looked like he had single coverage. So I said screw this, let’s protect this thing up and throw and let’s go get in the end zone. He did a great job coming down with the ball.”

On the first play of the first overtime, Reed threw a 25-yard touchdown pass to Keon Coleman at the goal line, giving the Spartans a 28-21 lead.

”Things have been tough this year,” said Reed who also had nine catches for 117 yards. ”But I think you guys can see that we’re a team that cares.”

Wisconsin’s Graham Mertz tied the game when he connected with Chimere Dike on a 25-yard scoring pass.

”Just really proud of our guys, just the way they’ve stuck together, handled adversity, responded to adversity, blocked out the noise,” said Michigan State coach Mel Tucker. ”We had very good intentional focus today as a football team.”

After Michigan State took a 21-14 lead, Mertz marched the Badgers 52 yards to even the game at 21 with 2:04 remaining on his 3-yard touchdown pass to Keontez Lewis.

On the ensuing possession the Spartans had an opportunity to win the game in regulation by driving to the Badgers’ 29-yard line. However, a bad snap on a 37-yard field goal forced holder Bryce Baringer to throw a pass that was intercepted by John Torchio.

Trailing 14-7 at halftime, Michigan State’s Elijah Collins tied the game at 14 with 54 seconds remaining in the third quarter when he capped an eight-play, 97-yard drive with a 1-yard run. Tight end Maliq Carr keyed the march when he caught a 72-yard pass and was forced out at the Wisconsin 12 by Kamo’i Latu.

Thorne tossed a 29-yard scoring pass to Coleman with 7:23 left to give the Spartans a 21-14 lead. The drive was kept alive by two pass interference penalties, including one on fourth and 4 from the Badgers’ 44-yard line.

Allen put the Badgers (3-4, 1-3) on top 7-0 when he capped their first drive with a 1-yard dive over a pile on fourth and 1. He gained 31 of Wisconsin’s 63 yards on the drive.

Michigan State tied it at 7 with 20 seconds left in the first when Wisconsin transfer Jalen Berger broke free for a 12-yard touchdown run. The score was set up following Windmon’s interception of Mertz at the Badgers’ 12-yard line.

Allen, who finished with 123 yards, gave Wisconsin a 14-7 lead on another 1-yard run early in the second. He started the 75-yard drive with a 34-yard before being run out of bounds.

”Great battle tonight,” Leonhard said. ”Obviously the way this one ended, it hurts. I’d never question the effort of our guys tonight. They put it all out there. Unfortunately we didn’t execute as well as we needed to in the second half. Obviously, in the second overtime as well. That’s the difference in the game.”

THE TAKEAWAY

Wisconsin: The Badgers defense gave up 389 yards, its most since allowing 539 to Ohio State on Sept. 24. Wisconsin will need to improve their pass defense against Purdue to avoid a two-game losing streak.

Michigan State: After giving up an average of 528.5 yards over the last four games, the Spartans played one of their best defensive games of the season. Michigan State gave up only 283 yards to Wisconsin, including only 131 passing yards.

UP NEXT

Wisconsin: Hosts Purdue on Oct. 22 in a key Big Ten West game and then has a bye week.

Michigan State: Has a bye week and then goes on the road Oct. 29 to play Michigan.

More AP college football: https://apnews.com/hub/college-football and https://twitter.com/AP-Top25. Sign up for the AP’s college football newsletter: https://apnews.com/cfbtop25.