The Owls led 2-1 going into the last five minutes before Shrewsbury roared back with Shaun Whalley's equaliser followed by a Jack Grimmer winner deep into stoppage time
Wednesday had twice taken a one-goal advantage through Lewis McGugan's brace either side of Jean-Louis Akpa Akpro pulling one back for the Shrews, who stunned their visitors in the closing minutes to complete a memorable win
Wednesday started brightly and McGugan drove over from 25 yards before he fired the visitors in front in the 19th minute.
Awarded a free-kick 25 yards out on the left, McGugan's strike found its way to the bottom corner of the net.
Wednesday might have doubled their lead just before the interval but Lucas Joao headed an inviting cross from Modou Sougou over the bar.
Shrewsbury, third round conquerors of Cardiff, enjoyed plenty of possession but chances were hard to come by - although Junior Brown saw a shot deflected off target.
Shrewsbury equalised in the 56th minute when Akpa Akpro headed in a cross from Andy Mangan.
Wednesday regained the lead in the 76th minute thanks to McGugan smashing in a 20-yard drive which took a deflection on its way in.
But Shrewsbury never gave up and levelled matters at 2-2 four minutes from time
Akpa Akpro was tripped by Vincent Sasso and, although his penalty was well saved by Lewis Price, substitute Whalley was on hand to turn in the rebound.
Shrewsbury then grabbed a dramatic late winner when Scott Vernon's cross was headed home by Grimmer, on loan from Fulham, to send Micky Mellon's League One strugglers into the last 16 for the first time since the 1990/1991 season.
Source : PA