CHAMPAIGN, Ill. — James McCourt kicked a 39-yard field as time expired and Illinois pulled off the biggest upset of the college football season so far, knocking off No. 6 Wisconsin 24-23 on Saturday.

Tony Adams picked off a pass by Jack Coan for the Illini (3-5, 1-3 Big Ten), who were 301/2-point underdogs, at midfield with 2:33 remaining that set up the winning drive.

Dre Brown’s tackle-breaking 13-yard run got Illinois to the Wisconsin 25 with 34 seconds left and then the Illini set up McCourt to attempt a winner. The junior kicker was down the middle with the field goal to give coach Lovie Smith the most significant victory of his four-year tenure in Champaign.

“Our program, we needed to get a signature win. I was just hoping today was the day, and the day came,” Smith said.

Fans rushed the field when it was over and “Jump Around” — a signature song at Wisconsin’s Camp Randall Stadium — blared through the speakers at Memorial Stadium.

After the first six weeks of the college football season produced few surprises at the top of the rankings, there have now been major upsets in consecutive weeks. Last week it was then-No. 3 Georgia losing at home to South Carolina in double overtime. Wisconsin becomes the second-highest ranked team to lose to an unranked foe this season.

But this was even more stunning.

The Badgers hadn’t trailed this season and were looking to roll into a showdown with No. 4 Ohio State next week in Columbus. Illinois lost to Eastern Michigan earlier this season and hasn’t even been bowl eligible since 2014. Instead, the Badgers (6-1, 4-1) blew a nine-point lead in the final 9:46 of the fourth quarter Saturday.

Illinois beat a ranked team for the first time since 2011 and knocked off a ranked Big Ten team for the first time since 2007, when the Illini beat No. 1 Ohio State in November on their way to a Rose Bowl appearance.

The last time Illinois beat a ranked Big Ten team at home was October 2007, a 31-26 victory against No. 5 Wisconsin.

Heisman Trophy contender Jonathan Taylor rushed 28 times for 132 yards and one touchdown for Wisconsin, but he also lost a fumble in Illinois territory in the fourth quarter to help fuel the Illinois comeback.

“We had two drives late in the game that ended in turnovers,” Wisconsin coach Paul Chryst said. “It’s always hard to win on the road, and that made it even harder. We just have to move on and learn from this.”

Coan was 24 of 32 passing for 264 yards and a touchdown, but his one interception came at a crucial time. He sailed a pass on third-and-5 that Adams grabbed to give the Illinois a short field against the No. 1 defense in the nation.

Illinois had cut Wisconsin’s lead to 20-14 late in the third quarter on a 43-yard touchdown run by Reggie Corbin.

Wisconsin had opportunities to pad its lead, but settled for a field goal after a first-and-goal from the 3, and then Taylor fumbled at the Illinois 25.

After the fumble, the Illini ripped off a 75-yard touchdown drive, capped by Brandon Peters’ 29-yard pass to Josh Imatorbhebhe to make it 23-21 with 5:53 left.