Wales international Andy King grabbed a dramatic stoppage-time winner to keep Leicester City's pursuit of a play-off place on track.
A goalless stalemate appeared inevitable as the Foxes mounted one final attack with just seconds of the four extra minutes remaining.
Nicky Adams swung over a corner, Dany N'Guessan had a shot cleared off the line and, in the scramble which followed, King applied the final touch from close range to spark wild celebrations among players and the crowd.
A frustrating afternoon appeared to be on the cards for City from as early as the fifth minute when Matt Fryatt was put clean through by Martyn Waghorn, but the usually lethal striker dragged his shot wide from 12 yards.
The next clear chance arrived midway through the first half when a half-cleared corner fell to Richie Wellens whose 16-yard thunderbolt was punched away by Romain Larrieu.
Larrieu then got down smartly to keep out Bruno Berner's angled drive.
City continued to press and almost took the lead with an own goal when Kari Arnason clipped the crossbar while attempting to clear a Paul Gallagher free-kick.
Wayne Brown almost gave City a half-time lead with a close-range header, but Shane Lowry somehow got back to scramble the ball clear.
Leicester resumed their siege after the restart with Waghorn hooking a shot over and then the same player directed a header straight to the keeper.
On the hour mark a Gallagher shot was diverted just wide before City had a penalty claim waved aside after Arnason appeared to handle inside the box.
Substitute N'Guessan had a shot late on for City which Larrieu smothered with Fryatt waiting to pounce.
And with that City's best chance appeared to have gone until King's late, late show.