Robyn Pinder scored a dramatic 97th-minute winner to give Swansea City Women all three points at The New Saints in the Genero Adran Premier.
After a goalless first half, Stacey John-Davis broke the deadlock as she tapped home her first goal of the season from close range.
However, the Swans looked like having to settle for a point after a strike from distance by Ella Hartley levelled matters with just six minutes to go.
But the visitors had other ideas, with substitute Pinder firing home deep into added time to extend Swansea’s winning run to three games in all competitions.
The Swans had controlled the early stages of the game, with Chloe Chivers trying her luck from distance only to be denied by the TNS goalkeeper.
John-Davis then came close to an opener just six minutes in, linking up with Sammy Wynne before turning in the box, but she fired her effort just wide.
Chivers had another sight of goal just four minutes later after a great ball from Katy Hosford found the forward, but her low effort flew just past the post.
The chances kept coming for Swansea, and skipper Hosford had a chance of her own just before the break, but she could not hit the target after a loose ball fell to her in the area.
It remained goalless at the interval, but it was the hosts who had the first clear opportunity of the second half. Chantelle Teare found space on the edge of the box but fired well over the bar.
Hosford was in the thick of the action again after she cut inside from the left, but her curling effort flew just wide of the post.
But the Swans would finally find the breakthrough just after the hour mark. Nieve Jenkins picked out John-Davis in the six-yard box to tap home.
TNS almost levelled immediately with a great delivery into the box being headed just wide.
Jenkins almost doubled the visitors’ lead with a header at the back post, rising above the TNS defence to meet Hosford’s corner but sending the ball off target.
And the Swans looked set to pay for their missed opportunities when TNS grabbed an equaliser as Hartley’s strike from distance found the top-right corner of the net to beat keeper Claire Skinner.
But the Swans snatched all three points with almost the last kick of the contest, Pinder slotting home from a great ball by Alicia Powe.
The win sees the Swans climb to third in the Genero Adran Premier table, just three points off the top spot.
The New Saints Women: Mackenzie Haydn-Jones, Beth Lewis (captain), Chantelle Teare (Ellie Hill 90), Ella Hartley, Tia Lockley, Caitlin Chapman, Helen Evans, Isobel Redding, Lia Lewis, Emily Ridge, Evie Williams.
Unused subs: Sarah Parkes, Nicole Samson, Danielle Staley, Matilda Edge.
Swansea City Women: Claire Skinner, Alicia Powe, Lucy Finch (Steph Turner 52), Ellie Lake, Nieve Jenkins (Robyn Pinder 86), Chloe Chivers (Monet Legall 61), Katy Hosford (captain), Stacey John-Davis, Sammy Wynne (Kelsey Thomas 86), Sophie Brisland-Hancocks, Jess Williams.
Unused subs: Chelsea Herbert.