Nathan Scheelhaase completed 24 of 30 passes for 257 yards and two touchdowns and Josh Ferguson ran for a career-high 115 yards for the Fighting Illini (4-7, 1-6 Big Ten), who snapped a six-game losing streak this season and a 20-game skid in conference play.
Akeem Hunt ran for a career-high 102 yards and a touchdown and Danny Etling completed 20 of 29 passes for 163 yards for Purdue, (1-10, 0-7), which has lost nine in a row.
Purdue had a chance to win late. The Boilermakers reached the Illinois 30-yard line, but Etling was pressured and threw an interception to V'Angelo Bentley to end the threat with just under a minute to play.
On Purdue's first possession of the game, Hunt took a pitch, made some nifty moves and broke loose for a 62-yard touchdown run, giving the Boilermakers a 7-0 lead just 85 seconds into the game. The Boilermakers had been shut out in the first quarter of its five previous games.
Illinois responded by going 80 yards in nine plays to tie the score. Scheelhaase found Hull found for a 3-yard touchdown pass.
Etling connected with Cameron Posey for an 8-yard scoring pass to give Purdue a 14-7 lead. Brandon Cottom gained three yards on a fourth-and-2 to keep the drive going. Etling connected on all five of his passes for 44 yards on the possession.
Purdue led 14-7 at the end of the first quarter, but the Boilermakers maintained their advantage for just six seconds in the second quarter. Scheelhaase's 30-yard touchdown pass to Hull tied the score.
Late in the quarter, Illinois' Spencer Harris caught a pass from Scheelhaase, but Ricardo Allen forced him to fumble and Bruce Gaston recovered at the Illinois 26-yard line. The Boilermakers failed to capitalize as Paul Griggs missed left on a 35-yard field-goal try with 2 seconds left in the first half, and the score was 14-all at the break.
Illinois threatened on its first possession of the third quarter, but Allen intercepted Scheelhaase near the goal line.
Purdue caught another break when Illinois' Bentley muffed a punt and Jesse Schmitt recovered at the Illinois 27. The Boilermakers came up empty after holder Cody Webster ran on a fake field goal and was stopped short of the first down.
Frankie Williams of Purdue returned a punt 84 yards for a touchdown late in the third quarter, but it was called back because of an illegal block in the back.
Early in the fourth quarter, Hull caught a 42-yard pass from Scheelhaase to put Illinois in scoring range. Taylor Zalewski's 32-yard field goal gave the Fighting Illini a 17-14 with 12:28 remaining.
Later, Illinois appeared to score a touchdown, but Martize Barr went out of bounds before catching the ball in the end zone, so he drew an illegal touching penalty. Zalewski made a 23-yard field goal to push Illinois' lead to 20-14 with 7:08 to play.
Purdue scored a team safety on the final play of the game as Illinois ran out the clock.