EAST LANSING, Mich. (AP) -- Curtis Painter threw two touchdown passes and Casey Welch kicked an 18-yard field goal with 4:49 left to lead Purdue to a 17-15 victory over Michigan State on Saturday.
Painter was 21-of-30 for 286 yards and connected for two TD passes to Dorien Bryant, who had seven receptions for 96 yards for Purdue (6-4, 3-3 Big Ten).
Drew Stanton was 16-of-29 for 161 yards, including a 21-yard TD pass to T.J. Williams with just over 14 minutes left to give the Spartans their first lead, 15-14. But Stanton was intercepted by Justin Scott with 6:29. The Boilermakers capped a five-play, 36-yard drive with Welch's field goal.
The loss was another blow to struggling Michigan State (4-6, 1-5), which announced Wednesday that head coach John L. Smith will not return next season.
Purdue scored on the first series of the game, a five-play, 72-yard drive that ended with a 25-yard touchdown pass from Painter to Bryant.
They connected again for an apparent 3-yard scoring pass with around 9 minutes left in the second quarter and Purdue leading 7-3. The play was called back, however, because of an offensive pass interference penalty that left Purdue facing a third-and-17 from the Michigan State 18.
On the next play, Clifton Ryan sacked Painter for a 15-yard loss. Chris Summers attempted a 50-yard field goal, but was wide left.
Painter's 7-yard TD pass to Bryant with 40 seconds remaining in the first half gave the Boilermakers a 14-6 halftime lead.
Brett Swenson kicked field goals of 22 and 46 yards to account for the Spartans' first-half scoring.
Swenson's 40-yard field goal with just over 11 minutes left in the third quarter pulled Michigan State to within 14-9. But the Spartans failed to capitalize after Ryan Allison recovered Brandon Fields' ensuing onside kick at the Purdue 48.