Ryan Christie came off the bench to steer Bournemouth past Swansea and into the third round of the Carabao Cup, just as penalties were looming.
The Scotland international turned the ball into the far corner in the first minute of stoppage time after he was fed by fellow replacement Justin Kluivert to seal a 3-2 victory.
Swansea had made spot-kicks appear likely when another substitute, Jamie Peterson, drove the ball through a crowd of players to make it 2-2 with 11 minutes remaining, but Christie had other ideas.
It was a deserved win for the Cherries, who are still searching for their first Premier league victory of the season.
The Swans had taken a first-half lead through a penalty from Matt Grimes, but fell behind in the second half as they suffered at the hands of Wales international David Brooks.
It was his well-taken strike that levelled things up at 1-1 in the 55th minute before the same player supplied the cross from which Hamed Traore gave the Cherries a 2-1 lead.
Bournemouth reacted to their 2-0 home defeat to Tottenham by making seven changes, including giving a debut to goalkeeper Andrei Radu.
The loan signing from Inter Milan had previously sat on the bench for three Premier League matches this season.
Wales striker Kieffer Moore, a loan target for Cardiff City among others, was handed his first start of the season.
Swansea made five changes from the side that had lost 2-1 away at Preston, a result that left them still searching for a first league victory under new head coach Michael Duff.
But they took a deserved lead in the ninth minute through a penalty from their skipper Grimes.
A Swansea free-kick on the left was only half-cleared before a rising drive from Liam Cullen was blocked by the arm of Bournemouth’s Wales defender Chris Mepham.
Referee Matthew Donohue had no hesitation in awarding the spot-kick from which Grimes scored his first goal of the season.
It took the Cherries a while to muster much of a response, but they should have levelled through Traore just before the half hour.
The Ivorian was given time to place his shot after being teed up by Brooks, but his effort from 10 yards was dragged beyond the far post.
Just before the break, Traore went closer when he struck the outside of the post after he turned sharply near the penalty spot.
Cherries boss Andoni Iraola made three changes at half-time – taking off Moore, Lloyd Kelly and Joe Rothwell, who were replaced by Dominic Solanke, Milos Kerkez and Lewis Cook.
The improvement was immediate and after sustained pressure the visitors equalised through Brooks in the 55th minute.
Traore controlled possession in midfield and struck a beautiful volleyed pass wide out to Brooks on the right who had been given too much space by Swansea.
The Cherries captain for the night controlled the ball instantly and then drilled a precise low drive across goalkeeper Carl Rushworth and into the far corner.
Brooks then reached the byline and although Solanke’s header struck the bar, Traore was on hand to force the ball home to make it 2-1.
Paterson was on target for Swansea from a rare attack to level the scores, but the class of the Premier League club eventually told when Christie scored his winner.