Chris Maguire scored in injury time to give Sheffield Wednesday a dramatic Championship win over Millwall.
Maguire hooked in Danny Pugh's corner to move Dave Jones's side away from the drop zone, as Millwall head to an FA cup semi-final on the back of a defeat.
Earlier, Jimmy Abdou had given the home side the lead after only one minute, slotting in from Chris Taylor's cross.
But the visitors fought back through Miguel Llera's free-kick before Maguire's last-gasp strike.
Kenny Jackett's men had been unbeaten in their previous five league and cup games and got off to the perfect start.
Taylor was allowed to cut in from the left, make his way into the box and deliver a low cross for the unmarked Abdou to bundle home at the far post.
Millwall continued to push forward, and nearly got a second through full-back Shane Lowry, who came close with a strike.
Wednesday had barely threatened but levelled as Llera curled a 25-yard set-piece around the wall and into the net.
And Taylor could have put Millwall back into the lead on the stroke of half-time but his backheel from Lowry's cross flew straight at Chris Kirkland.
Both sides had chances in the second period with Jermaine Easter firing wide and Kirkland denying Taylor, before Maguire's effort moved Wednesday six points clear of the relegation zone.
Millwall manager Kenny Jackett:
"For large parts we were in control, we've let Sheffield Wednesday off the hook in the end.
"We got an early goal, at home, and so we should have gone on to win that game.
"But I didn't feel we were looking at Saturday. Their keeper was the busier.
"We realistically should beat our total of last year, 59, and I wouldn't want to think the FA Cup had interfered with that."
Sheffield Wednesday manager Dave Jones:
"We weren't going to let them go into the semi-final in relaxed mode.
"It was a good finish for the winner. It was the best time to score - with 30 seconds left. Everybody's done their job, certainly in the second half.
"In the first half I was disappointed with the way we started but our first goal settled us down. It could have gone either way. We both had chances. Every win in this division is a big win."