Match ends, Shrewsbury Town 3, Sheffield Wednesday 2.
Jack Grimmer scored an injury-time winner as League One strugglers Shrewsbury twice came from behind to beat Sheffield Wednesday.
Lewis McGugan's 35-yard free-kick put the Championship side ahead before Jean-Louis Akpa Akpro levelled.
McGugan again struck from distance only for substitute Shaun Whalley to pounce after Akpa Akpro's penalty was saved.
In an amazing finale, Grimmer headed home in the 97th minute to put the underdogs through to the fifth round.
It is the first time in 25 years that Shrewsbury - who beat Championship side Cardiff in the previous round - have reached the last 16.
Leading 2-1 going into the final five minutes, Championship promotion hopefuls Wednesday could have been forgiven for thinking they had all but secured their cup progress.
But the hosts, who enjoyed plenty of possession and had 11 shots on target - six more than their opponents - refused to cave in.
Akpa Akpro was tripped by Vincent Sasso in the dying minutes and, although Lewis Price saved the penalty, Whalley converted the rebound.
On-loan Fulham defender Grimmer then sparked jubilant celebrations when he headed in Scott Vernon's cross, sending relegation-threatened Shrewsbury into the fifth round for the first time since the 1990-1991 season.
What they said
Shrewsbury manager Micky Mellon: "To have this club involved in games like this and challenging with Sheffield Wednesday to get into the fifth round of the cup is where we should be.
"We were every bit as good in that second half as we have been poor in other games. We worked very hard on our game plan on the training pitch and all the players stuck to it.
"People are asking for attacking football. I cannot do any more than my right-back getting on the end of a cross in the 97th minute!"
Sheffield Wednesday manager Carlos Carvalhal on the club's official website: "We did everything we could to get to the next round, and I will make no excuses, but our priority is the Championship.
"We will now fight 100% to focus on doing well in the league.
"It was also good for us to have players back in this game, as they can help us more in the second half of the season."
- 31SmithSubstituted forWallaceat 78'minutes
- 20Knight-PercivalBooked at 68mins
- 15GrimmerBooked at 37mins
- 6BlackSubstituted forWhalleyat 79'minutes
- 26Akpa-AkproSubstituted forVernonat 90+1'minutes
- 24SougouSubstituted forWallaceat 71'minutesBooked at 87mins
- 7MatiasSubstituted forLeeat 78'minutes
- 14HooperSubstituted forNuhiuat 61'minutesBooked at 84mins
- 18Lucas JoãoBooked at 89mins
- Paul Tierney
- Shots on Target
Second Half ends, Shrewsbury Town 3, Sheffield Wednesday 2.
Goal! Shrewsbury Town 3, Sheffield Wednesday 2. Jack Grimmer (Shrewsbury Town) header from the centre of the box to the bottom left corner. Assisted by Scott Vernon.
Corner, Sheffield Wednesday. Conceded by Zak Whitbread.
Attempt missed. Lewis McGugan (Sheffield Wednesday) right footed shot from outside the box is just a bit too high.
Scott Vernon (Shrewsbury Town) wins a free kick in the defensive half.
Foul by Michael Turner (Sheffield Wednesday).
Substitution, Shrewsbury Town. Scott Vernon replaces Jean-Louis Akpa-Akpro.
Lucas João (Sheffield Wednesday) is shown the yellow card for a bad foul.
Foul by Lucas João (Sheffield Wednesday).
Shaun Whalley (Shrewsbury Town) wins a free kick in the defensive half.
Goal! Shrewsbury Town 2, Sheffield Wednesday 2. Shaun Whalley (Shrewsbury Town) right footed shot from the centre of the box to the bottom left corner.
Penalty saved! Jean-Louis Akpa-Akpro (Shrewsbury Town) fails to capitalise on this great opportunity, right footed shot saved in the centre of the goal.
Penalty conceded by Vincent Sasso (Sheffield Wednesday) after a foul in the penalty area.
Penalty Shrewsbury Town. Jean-Louis Akpa-Akpro draws a foul in the penalty area.
Corner, Shrewsbury Town. Conceded by Vincent Sasso.
Atdhe Nuhiu (Sheffield Wednesday) is shown the yellow card for a bad foul.
Foul by Atdhe Nuhiu (Sheffield Wednesday).
James Wallace (Shrewsbury Town) wins a free kick in the attacking half.
Foul by Lucas João (Sheffield Wednesday).