James Bree scored an 88th-minute winner as Southampton edged past Championship side Stoke City to book their place in the quarter-finals of the Carabao Cup.
Bree struck a shot from the edge of the area into the bottom corner after latching on to Kamaldeen Sulemana's pass.
The Saints had opened up a two-goal lead in the first half when Taylor Harwood-Bellis rose highest in the box to head home from Matheus Fernandes' corner and Adam Armstrong converted a penalty after Jaden Dixon caught Yukinari Sugawara in the box.
Stoke pulled one back on the stroke of half-time when left-back Eric Bocat's free-kick bounced off Sugawara into the path of Ashley Phillips who scored his first senior goal with a brilliant backheel finish.
Junior Tchamadeu's cross was deflected into the path of Tom Cannon who fired into the top corner with a first-time finish at the far post to level the scoring nine minutes after the break.
Substitute Million Manhoef was close to bundling the ball across the line to give Stoke a late lead but Sugawara slid in on the line to produce a vital interception.
Minutes later, Bree was the hero for Russell Martin's Saints as they avoided a penalty shootout and progressed to the next round.
Saints boss Martin watched on from high up in the stands due to a touchline ban for accumulating three yellow cards this season as his side dominated the game with 77% possession.
Speaking to BBC Radio 5 Live after the match, Martin said: "It should have been easier than what it was, we were so dominant in the first half and should have gone in 2-0 up so I'm a bit annoyed at that.
"By the time I left the stands we were 2-0 up and it was 2-1 by the time I got down so I was annoyed and frustrated.
"We won I'm happy, of course we can improve and there is a lot to build on. We had a really good performance in a lot of parts tonight and we won."
It is the first time Southampton have won in any competition since they beat Everton 6-5 on penalties in the third round last month. They will find out their next opponents when the quarter-final draw takes place on Wednesday.
Player of the match
After the opportunity to rate players has closed, the score displayed represents the average from all the submissions by BBC Sport users.