A Nathan Ellington penalty deep in injury time ensured Derby dramatically progressed to the Carling Cup semi-finals for the first time in 40 years.
Richard Cresswell had a goal disallowed for hand-ball in a poor first half.
Both teams had chances after the break, with Kris Commons and Miles Addison both hitting the woodwork for Derby.
An excellent Roy Carroll save prevented Ricardo Fuller from scoring before Derby were awarded the penalty on 94 minutes for an Andy Griffin handball.
The game was seemingly heading towards extra-time when Griffin handled Przemyslaw Kazmierczak's cross to leave referee Rob Styles with little option but to award the spot-kick.
Ellington then coolly rolled the ball beyond Steve Simonsen in front of the delirious visiting supporters.
It was the first time Rams boss Paul Jewell had presided over a Derby victory at the expense of a Premier League team in 25 attempts.
And the Championship side fully deserved to beat a Stoke line-up which, although featuring five changes from the team which drew with Hull at the weekend, had a strong backbone in the form of Ibrahima Sonko, Rory Delap and Fuller.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.