Town 3 Sheff Wed 2 - Report and pictures
Jack Grimmer sent Shrewsbury Town into dreamland as they clinched a place in the FA Cup fifth round for the first time in 25 years.
The on-loan Fulham right-back headed the winner in the seventh minute of time added on.
It was a see-saw game as Town - who were never out of the game - trailed to Lewis McGugan goals on 19 and 76 minutes.
They levelled each time through Jean-Louis Akpa Akpro on 56, then substitute Shaun Whalley on 87 before Grimmer's bullet header.
Indeed, Town could have had two penalties in the 82nd minute when Andy Mangan then Whalley appeared to be fouled.
Wednesday had what looked to be a spot kick denied when Zak Whitbread climbed on Atdhe Nuhiu at 2-2.
Town made three changes from the side beaten 1-0 by Oldham on Tuesday. Dominic Smith, Jordan Clark and Akpa Akpro replaced James Wallace, Richie Wellens and Kyle Vassell.
Wellens and Vassell were cup-tied, academy graduate Ethan Jones was in the squad for the first time and Abu Ogogo returned to the 18 after missing the last three games with a hamstring injury.
Wednesday will try to cement their top-six position in the Championship with games against play-off rivals Burnley and Birmingham in the next week.
They made nine changes to the line-up that drew 1-1 at Reading last week.
Shrewsbury Town (3-5-2): Leutwiler; Smith (J Wallace 79), Whitbread, Knight-Percival; Grimmer, Black (Whalley 79), Clark, Cole, Brown; Akpa Akpro (Vernon 90+1), Mangan.
Subs not used: Sadler, Ogogo, Jones, Halstead (gk).
Sheffield Wednesday (4-4-2): Price, Palmer, Sasso, Turner, Bennett; Sougou (R Wallace 71), McGugan, Semedo, Matias (Lee 78); Hooper (Nuhiu 61), Joao.
Subs not used: Bus, Pudil, Bannan, Dawson (gk).
Referee: Paul Tierney.
The Owls had the first chance in the sixth minute when Lewis McGugan let fly with a fierce, first-time rising volley from 25 yards but it sailed a foot over.
Town replied three minutes later, as Ian Black dragged a low effort well wide after Andy Mangan chased it into the corner and fed Jordan Clark.
The home side then had the chance to threaten from a free kick but Junior Brown curled several yards over the angle of post and bar.
Town had a great chance on 17 as Akpa Akpro lobbed forward to put Mangan in the clear but he seemed to misjudge the bounce and it carried through to keeper Lewis Price.
But two minutes later Mellon's side were made to pay as McGugan's curling free kick carried all the way into the net from 30 yards after Zak Whitbread fouled Marco Matias.
Goalkeeper Jayson Leutwiler appeared to be waiting for some contact to react but it sailed right through into the far corner of the net.
Town remained in the game and Mangan laid it off to Brown, who cut in and saw a right foot shot deflected behind.
The hosts almost threatened again on 32 minutes when Clark centred but Larnell Cole couldn't get a left-foot shot in as a Wednesday block came in from the side.
Jack Grimmer was booked on 37 for sliding in on Matias around the shins for a free kick on the Owls' left.
McGugan again swung it in dangerously but Gary Hooper flicked it well over the bar from six yards out.
Five minutes before the break, Town created their best passing move which ended with Mangan turning on Grimmer's cross and trying to slot in Cole rather than shoot and it rolled out of play.
But Wednesday hit back to force the pace before the break and leave Shrewsbury grateful of the half-time whistle.
A loose ball was seized on by Marco Matias, whose left foot drive was palmed away by Leutwiler diving to his left, the rebound dropping away from Lucas Joao.
In the first minute of time added on, Joao got between Whitbread and Knight-Percival from Sougou's cross but glanced over.
Town had the first effort of the second half when Akpa Akpro fired a long-range snapshot narrowly wide.
On 55 minutes, Wednesday went close when Joao flashed a near-post header right across the face of goal from Joe Bennett's inswinging corner.
But Town were level just a minute later when Akpa Akpro sent a classic downward header into the net after great work by Mangan, who chased Black's pass into the corner before turning and crossing.
Leutwiler had to be alert on 61 though when Jose Semedo tried to bend it around him and the keeper responds with a smart dive to his left to palm it away.
Two minutes later, Town had a great chance when Black chipped forward.
Akpa Akpro beat the offside trap only for his shot to be saved, Liam Palmer hacking the ball away from near the line as it trickled goalwards.
Black was next to try his luck, flicking the ball up and volleying just wide after Brown's cross was half cleared.
Somewhat against the run of play, McGugan seized on a poor clearance from Brown and struck it sweetly with the outside of his right foot from 25 yards, the ball deflecting in off Zak Whitbread.
But Town weren't to be denied and had two penalty calls, as Mangan tumbled under challenge then Whalley more convincingly went down from what looked like a push from Michael Turner.
Shrewsbury finally won a spot kick on 86 when Vincent Sasso tripped Akpa Akpro as he turned inside him.
Price saved Akpa Akpro's penalty diving to his left, but Whalley reacted quickest, following up to sidefoot home.
Wednesday were somehow denied a penalty of their own after Whitbread appeared to climb all over Atdle Nuhiu.
From somewhere, the fourth official produced six minutes of added tie and Town were in dreamland when Scott Vernon broke down the left.
He ignored Mangan and kept going before crossing for Grimmer, whose bullet header gave Price no chance.