Nathan Ellington's last-gasp penalty fired Derby County into the Carling Cup semi-finals and sent 4,500 travelling fans into delirium at the Britannia Stadium.
Both sides had squandered a succession of chances in the second half and extra-time looked a certainty until Stoke City's Andy Griffin handled a cross from Przemyslaw Kazmierczak.
The linesman closest to the incident gave nothing, but referee Rob Styles pointed to the spot and Ellington made no mistake as he sent Steve Simonsen diving in the wrong direction.
There was plenty of effort but a distinct lack of quality in the opening stages, with Derby comfortably defending a couple of corners and the long throws from their former player Rory Delap.
Both goalkeepers were virtually spectators until Derby midfielder Miles Addison warmed Simonsen's hands with a 25-yard shot just after the half hour.
And the Stoke fans were celebrating briefly five minutes later when Richard Cresswell's shot into the net was ruled out after Mr Styles spotted an infringement.
Stoke did finally begin to build a head of steam as half-time approached and Seyi Olofinjana was unfortunate when his goal-bound shot was deflected for a corner.
But it was Derby who came within inches of taking the lead three minutes after the interval.
Ellington's terrific cross from the left was headed against the bar by ex-Stoke midfielder Kris Commons and Rob Hulse nodded the rebound wide of a gaping net.
The contest was finally opening up and Ricardo Fuller missed the boat when he took too long to shoot from Mamady Sidibe's pass, allowing Jordan Stewart to make an excellent saving tackle.
And Fuller was then unusually wayward with a header from close range after his strike partner Sidibe again set up the chance.
A shot from Commons was deflected over the top at the other end, where Derby's packed hordes remained full of encouragement.
Sidibe then missed the chance of the game so far when he skewed his shot wide from six yards, with Fuller this time supplying the ammunition.
The chances continued to come thick and fast as Addison diverted Kazmierczak's corner against the outside of a post, before Glenn Whelan's free-kick was superbly tipped over by Roy Carroll.
But it was Derby who made the last-gasp breakthrough to book their place in the last four.