Ryan Christie's stoppage-time goal gave Bournemouth their first win under boss Andoni Iraola against Swansea City.
Captain Matt Grimes had given Swansea a half-time lead from the penalty spot but Bournemouth hit back with goals by David Brooks and Hamed Traore.
Jamie Paterson's equaliser nearly took the EFL Cup tie to a penalty shoot-out.
But Christie, set up by fellow substitute Justin Kluivert, netted in the first additional minute to send the Premier League side into round three.
Traore's first Cherries goal had looked to complete the visitors' comeback after substitute Dominic Solanke hit the post with a header, leaving an easy finish for the Ivorian.