Southampton had Peter Crouch and Kevin Phillips to thank as they battled from a goal down to squeeze past gritty League One side Brentford.
Eddie Hutchinson had already wasted a good chance for the Bees when he fired them ahead from eight yards.
But the Saints were soon level thanks to Crouch's neat sidefoot finish.
A breakaway Phillips goal from a Crouch cross made it 2-1 and Crouch's close-range shot set up a home FA Cup quarter-final with Manchester United.
Brentford made a sensational start and could have been 2-0 up by the fifth minute.
A half-cleared Jay Tabb free-kick fell invitingly to Hutchinson who should have scored but somehow screwed his shot across the face of the goal from eight yards with the goal gaping.
Moments later the all-action midfielder made amends as he calmly sidefooted home after former Bees keeper Paul Smith flapped at a high cross and failed to gather the follow-up shot.
Southampton refused to panic and Phillips, restored to the starting line-up ahead of Henri Camara, played a big part in the equaliser.
The former England striker was left completely unmarked in the box and controlled Mikael Nilsson's fine throughball on his chest, turned and fired a shot towards goal.
Stuart Nelson acrobatically tipped the ball away but Crouch calmly tucked away the rebound from close range.
Thankfully the quality of football did not match the diabolical playing surface which was in a terrible state following Brentford's home fixture on Saturday and the London Broncos' Super League match on Sunday.
Unsurprisingly Brentford looked the more comfortable and although Phillips' movement and Crouch's presence and awareness were causing problems, it was the home side who were looking the more dangerous.
Michael Turner (left) and Eddie Hutchinson celebrate Brentford's early opener
The Bees were dominating possession against a Southampton midfield missing Nigel Quashie, Jamie Redknapp, Graeme Le Saux and David Prutton.
Home skipper Stuart Talbot had a shot blocked and Deon Burton saw a curling effort deflect over.
And with the pressure mounting Hutchinson almost grabbed his second.
Veteran winger John Salako swung in a right-foot cross and Hutchinson's header cannoned off the bar with Smith stranded on his six-yard line having chosen to come for the cross.
Burton then saw his follow up effort hacked off the line as the Saints were left praying for half-time.
Chances continued to come thick and fast after the break.
Tabb raced away but shot wide, Paul Telfer had a stinging 20-yard effort bundled to safety by Nelson and Burton fizzed a low volley inches wide from another Salako cross.
Brentford continued to pile forward and paid the price when Saints caught them on the counter attack.
Olivier Bernard surged out of defence and spread the ball wide to Crouch on the right and his excellent low cross to the far post was knocked in from close range by Phillips.
Sam Sodje nearly took advantage of a sloppy attempted clearance from Calum Davenport with the 90 minutes almost up but headed wide.
And Southampton settled it in injury time when Crouch rolled in his second from Neil McCann's cross following another swift break.
Brentford boss Martin Allen:
"It was a cracking night. All you can ask is that the players give everything they've got.
"And we played with passion and with quality. We competed for every ball, every pass and every challenge but in the end they just had a little bit too much quality.
"As a young manager I'm very proud of those players. We had a great start and had one or two chances but they fought back well."
Southampton boss Harry Redknapp:
"All the ingredients were here for an upset. They were excellent - they worked so hard and played so well. I'm just pleased we survived it.
"At half-time I said we had to play more football - pass the ball and keep hold of it for longer.
"A couple of the lads told me it was so difficult on the surface, but we managed it in the second half and that's when we played better."
Brentford: Nelson, Dobson (Peters 89), Sodje, Turner, Salako, Tabb, Hutchinson (O'Connor 83), Talbot, Frampton (Hunt 69), Rankin, Burton.
Subs Not Used: Lennie, Harrold.
Goals: Hutchinson 4.
Southampton: Smith, Telfer, Jakobsson, Davenport, Higginbotham, Nilsson, Oakley, Delap, Bernard (McCann 71), Phillips (Camara 78), Crouch.
Subs Not Used: Poke, Anders Svensson, Ormerod.
Goals: Crouch 11, Phillips 67, Crouch 90.
Ref: B Knight (Kent).