Oguchi Onyewu's first goal for 10-man Sheffield Wednesday secured victory over League Two Rochdale and a place in the fifth round of the FA Cup.
Joe Mattock, later sent-off for a second bookable offence, gave the Championship side the lead before Onyewu smashed home minutes later.
Rochdale captain Michael Rose rekindled home hopes with a 25-yard strike.
But despite being down to 10 men, Wednesday held on to reach the last 16 for the first time since 2011.
Caretaker boss Stuart Gray was handed a two-and-a-half year contract after watching only Wednesday's second away win of the season.
Gray, whose side are now unbeaten in eight, punched the air on the final whistle after seeing his team display the kind of battling qualities which resulted in Owls chairman Milan Mandaric offering him the permanent position.
Second in the league table, they will now be able to concentrate on securing promotion to the third tier of English football.
There was an air of expectancy amongst the home supporters at a rain-sodden Spotland as they welcomed a side battling to survive in the Championship, but 12 ruthless minutes at the start of the second half dashed their hopes.
American Onyewu, playing in only his second game for Wednesday
since leaving Queens Park Rangers
- for whom he did not play a single game - headed against the post late in the first-half as corners and free-kicks caused havoc.
And it was from another whipped delivery that the Owls took the lead on 50 minutes, Mattock tapping home a near-post flick-on.
Wednesday's travelling support of more than 3,000 were soon celebrating again when former Sporting Lisbon and Standard Liege defender Onyewu, 31, pounced from six yards to lash the ball low into the net.
The Championship side's clinical start to the second half drew focus on Dale's wasted opening in the first period, when Matt Done fired against the legs of visiting keeper Damian Martinez from 10 yards.
Done's midfield counterpart and captain Rose reduced the arrears in spectacular fashion from long range before his free-kick was well tipped over by Martinez.
Mattock saw red for a trip on Ian Henderson as home pressure built but Dale, unbeaten in four before kick-off, relied on a succession of crosses late on and could not carve out a meaningful opening as three-time FA Cup winners Wednesday progressed.
Rochdale manager Keith Hill:
"They scored from two set plays and we responded well and got the goal back but when they went down to 10 men it made it really difficult.
"They defended superbly against our extra man. The players can hold their heads high and we haven't let anyone down.
"We've got 19 real cup finals and there's magic in every one of those games for us because we can really achieve something this season."
Sheffield Wednesday head coach Stuart Gray:
"I asked the foreign lads at the team meeting what they thought about the FA Cup and now they'll realise. The atmosphere was fantastic, it was a typical FA Cup tie.
"There was a gale-force wind against us in the first half and we had to defend well and we did. It's just hard work, effort and commitment but all of the players deserve the credit for the effort they've been putting in.
"I would love a home draw against a big team because the fans deserve that and it would be a great atmosphere at Hillsborough."
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.