Charlie Griffin struck two minutes into stoppage time to send Newport County into the FAW Premier Cup semi-finals at the expense of high-flying Swansea.
Griffin celebrates his winner against Swansea at Spytty Park
Griffin's header from a right-wing cross went in off the bar as a game of few chances headed towards extra time.
Swansea created the best first-half openings, with Darryl Duffy and Kris O'Leary having efforts well saved.
Newport enjoyed plenty of possession after the break and Griffin's header gave Swansea no time to find a reply.
Conference South side Newport will now face Welshpool or Cardiff City in the semi-finals, while Swansea are left to contemplate an early Premier Cup exit for the second successive year.
Newport County manager Peter Beadle:
"Both teams played some decent stuff and they threw themselves at it and it was played in a great spirit, but we're just delighted to go through.
"We are best when our backs are against the wall at times which it has been over recent weeks and the last two performances in four days have been exceptional and the lads have got their just deserves for it."
Swansea City manager Roberto Martinez:
"It was a very close game. We created enough chances in the first half to score and we couldn't.
We had some good positive points for some of our youngsters and we will take it as part of their development and in that respect we need to move forward."
Newport County: Glyn Thompson, James Simpson, Damon Searle (capt), Nathan Davies, Lee Jarman, Ian Hillier, Jason Bowen, Lee Fowler, Charlie Griffin, Craig Hughes, Richard Evans.
Subs Not Used: Mark Dodds, Richard Evans, Jermaine Clarke, Julian Alsop, Tony Pennock.
Swansea City: David Knight, Alan Tate (capt), Kevin Austin, Kevin Amankwaah, James Burgin, Shaun McDoanld, Kris O'Leary, Chris Jones, Andrea Orlandi (Matthew Collins), Darryl Duffy, Joe Allen.
Subs Not Used: David Cornell, Jamie Grimes, Matthew Wright, Dion Chambers.