CHAMPAIGN, Ill. (AP) — Aidan O’Connell passed for 237 yards and three scores, two to Payne Durham, and Purdue beat No. 21 Illinois 31-24 on Saturday to turn the Big Ten West race into a muddled mess.

The win gives the Boilermakers (6-4, 4-3 Big Ten) a crucial head-to-head tiebreaker over the Illini (7-3, 4-3 Big Ten), who were firmly in control until losing their last two games.

The Boilermakers finish the season with favorable matchups against Northwestern and at Indiana.

Iowa, Wisconsin and Minnesota are still alive in the division, too, entering Saturday with 3-3 records. The Badgers and Hawkeyes were playing each other.

Purdue scored on three-straight drives to take a 28-21 lead on Durham’s 13-yard touchdown reception with 13:13 left, finishing a drive that was aided by three Illinois penalties.

The Boilermakers gave O’Connell plenty of time and excellent protection all day, holding a highly rated Illinois defense to zero sacks while getting to DeVito twice, including a costly 17-yard sack that took the wind out of an Illinois drive in the second half.

O’Connell completed 25 of 40 attempts and threw one interception. Devin Mockobee added 106 yards and a touchdown on 28 carries.

DeVito struggled against pressure and threw his first interception since a Sept. 10 win over Virginia. He completed 18 of 32 passes for 201 yards and a score.

Purdue also became the first team to hold Illinois star Chase Brown to fewer than 100 rushing yards this season. The nation’s leader in rushing yards also appeared to suffer a leg injury late in the game, when he had to be helped off the field.

Durham made his first touchdown grab to cap a 90-yard drive that put the Boilermakers up 21-14 midway through the third quarter, but Illinois answered as DeVito connected with Brian Hightower for a 6-yard score with 1:13 left in the quarter.

Kieren Douglas intercepted a tipped Tommy DeVito pass with 3:37 left, and Purdue killed plenty of clock with a few runs and a critical 15-yard reception by TJ Sheffield on 4th-and-9 to escape with the win.

Mitchell Fineran secured the result with a chip shot 25-yard field goal, then Illinois kicker Caleb Griffin added a late 38-yard field goal with 17 seconds left.

Brown nudged Illinois in front with a 2-yard run at the 8:07 mark of the first quarter, capping a 74-yard drive.

Brown scored on an 8-yard run later and struck the Heisman pose in celebration.

THE TAKEAWAY

Purdue: The Boilermakers came into Champaign on a two-game losing streak. Credit the effort in the trenches — the Boilermakers never gave up a sack and paved the way for Mockobee to clear 100 yards against one of the country’s top defenses.

Illinois: Back-to-back home losses have tempered the enthusiasm of a 7-1 start, and things don’t get any easier next week at No. 3 Michigan. Still, the Illini are a victory away from their first eight-win season since 2007 and have chance to get to the Big Ten title game for the first time. Illinois holds the tie-breaker over Iowa, Wisconsin and Minnesota.

UP NEXT

Purdue: Hosts struggling Northwestern next Saturday.

Illinois: A trip to No. 3 Michigan looms next Saturday.