The Illini (16-8, 3-7 Big Ten) trailed 41-29 at halftime and by double digits for most of the second half before closing the game on a 13-2 run over the final 3:36.
With the score tied, Indiana’s Victor Oladipo turned the ball over and recovered to block a breakaway layup by D.J. Richardson out of bounds with less than a second to play.
Griffey, who was open after setting a screen, took the inbounds pass from Brandon Paul with .9 seconds left and gently laid the ball into the basket.
Hundreds of Illinois students rushed the court, but held their collective breath while the officials checked replays to make sure Griffey had beaten the clock.
They erupted once more when the officials signaled the shot was good, and Paul and Richardson hugged and cried.
The upset ended a three-game losing streak for Illinois.
The Hoosiers (20-3, 8-2) took over the top spot in The Associated Press’ Top 25 on Monday.
Richardson had 23 points for Illinois, Paul had 21 and Griffey finished with 14 points and eight rebounds.
This was Illinois’ third win over a No. 1 team and first since beating Wake Forest in 2004.
Cody Zeller led Indiana with 14 points, while Will Sheehey had 13, Christian Watford 12 and Jordan Hulls 11.
Indiana shot 50 percent from the field (25 of 50), 52.9 percent from 3-point range (9 of 17) and 93 percent from the free throw line (13 of 14). The Hoosiers led by an 8- to 10-point margin for most of the second half.
When 6-foot-11 Nnanna Egwu fouled out with just under 5 minutes to play, the Hoosiers looked in control. Egwu is the only Illini player with the size to realistically match up with the 7-0 Zeller.
Watford made two free throws after Egwu’s fifth foul and, at 69-59, the Illini looked done.
But with the clock under 3 minutes, Richardson went on a run of his own, first burying consecutive 3-pointers and then hitting a midrange jumper on the run to tie the game at 70 with 1:17 to play.
Oladipo’s layup put the Hoosiers back on top with 50 seconds left, but Paul answered with two free throws, the first banked in, to tie the score again at 72.
With the clock under 30 seconds, Indiana had the ball for what would have been a last shot but Oladipo committed the turnover.
Griffey was benched several weeks ago as Illinois’ slump dragged on. On a team that had lost its shooting touch, the senior forward had grown especially cold. And, though one of Illinois’ bigger players at 6-9, he wasn’t adding much to the inside presence the Illini desperately needed.
Sheehey slammed a two-handed dunk home over Griffey, screaming as he stood just a few inches from the face of the Illinois forward.
The taunt drew a technical — and an eye roll from Hoosiers coach Tom Crean — but with just over a minute left in the half it made the score 39-25, effectively muzzled a near-capacity crowd and drove home the point that the game had tilted Indiana’s way as they led 41-29 at halftime.