Championship outfit Sheffield Wednesday broke Stockport's hearts with two goals in the last four minutes of extra-time at Edgeley Park.
It had looked like Adam Le Fondre's goal 12 minutes from the end of the extra half-hour was going to send the tie into a penalty shoot-out, but substitute Adam Proudlock pounced twice in the most dramatic of finishes.
League Two side Stockport made the perfect start with a quite sublime goal after eight minutes. Matt Hamshaw touched a free-kick to Danny Boshell and the midfielder rammed home a superb 25-yard drive right into the top corner.
However, Stockport were undone by a defensive slip just seven minutes later when Ashley Williams let Lee Peacock in and the Wednesday frontman comfortably fired home from 15 yards.
The remainder of the first half belonged to the visitors, with both Chris Brunt and Ritchie Partridge going close to a second goal for Paul Sturrock's side.
Wednesday started the second period positively and Peacock should have made it 2-1, while at the other end, Williams headed inches wide from Mark Robinson's superb cross.
With time running out Wednesday's Burton O'Brien smashed an angled drive just wide and then with the extra period just seconds away, Robinson bravely blocked Glenn Whelan's close-range shot on the Stockport goalline.