CHAMPAIGN, Ill. (AP) -- Quarterback Curtis Painter ran for two touchdowns and threw for another as Purdue rallied for a 42-31 victory over mistake-prone Illinois on Saturday.
The Boilermakers (7-4, 6-3 Big Ten) trailed by nine points in the third quarter before defensive end Alex Magee led a defensive charge that turned around the game.
Magee, who recovered a fumble by Juice Williams in the end zone for a second-quarter TD, intercepted a pass in the third quarter and forced a fumble in the fourth quarter to set up touchdowns.
Illinois (2-9, 1-6), who gave No. 1 Ohio State a scare in a seven-point loss a week ago, lost its sixth straight game.
The Illini turned the ball over four times in five plays during their second-half collapse, and Purdue scored touchdowns off three of the miscues after trailing 23-14.
Painter ran 42 and 18 yards for TDs in the second half and wide receiver Dorien Bryant caught a 20-yard touchdown pass to give Purdue a 28-23 lead with 2:02 left in the third quarter. Bryant also scored on a 6-yard run early in the fourth quarter.
Painter was 20-for-49 for 229 yards with a touchdown and interception, and ran for 54 yards. Bryant caught nine passes for 120 yards and a touchdown. Purdue had 431 yards of total offense.
The Boilermakers forced a season-high five turnovers. Defensive end Cliff Avril tipped a pass and recovered a fumble in the second half.
Williams, Illinois' freshman quarterback, rushed for a career-high 145 yards on 22 carries and scored his first touchdown on a 20-yard run to cap a 12-play, 80-yard drive on the first series of the game.
Illinois running back Pierre Thomas rushed for 105 yards on 10 carries and a touchdown as the Illini finished with 316 yards rushing.
Illinois Jason Reda made field goals of 38, 29 and 30 yards. Illinois led 16-14 at half.
Kory Sheets' 3-yard touchdown run in the first quarter capped an 11-play, 73-yard drive for Purdue's first score.
Williams fumbled in the end zone after being sacked by Purdue's Anthony Spencer early in the second quarter. Magee fell on the ball for the score to give Purdue a 14-10 lead.
Jonathan Taylor's NFL draft profile
Relive some standout moments and highlights from former Wisconsin running back Jonathan Taylor.
Patrick Queen's NFL draft profile
Check out some highlights that make former LSU linebacker Patrick Queen a top prospect in this year's NFL draft.
Utah RB Moss clocks 4.52 40-yard dash in solo workout
After recording a disappointing 4.65 40-yard dash at the NFL Combine, Utah RB Zack Moss stages his own workout and shows off his speed with an improved performance.
Mississippi State lineman enters transfer portal after Mike Leach tweet
Defensive lineman Fabien Lovett, who had responded to coach Mike Leach's now-deleted controversial tweet on Thursday, said he has entered the transfer portal and has three years of eligibility remaining.
Sources: SEC exploring Alabama's use of Apple watches
The SEC is exploring whether Alabama will be able to continue using Apple watches to monitor its football players' physical activities during the league-mandated shutdown caused by the coronavirus pandemic, sources told ESPN's Mark Schlabach on Friday.
SC Featured preview: How former Oregon WR Keanon Lowe became a hero
Take an inside look at how former Oregon WR Keanon Lowe is impacting the lives of others. Don't miss SC Featured Sunday on SportsCenter.