Tonia Antoniazzi polled 22,727 votes compared with the Tories' Byron Davies on 19,458 in what was the tightest marginal seat in the UK.
Labour's Nia Griffith retained Llanelli while the party's Carolyn Harris kept Swansea East.
Shadow defence secretary Ms Griffith polled 21,568 votes with Conservative Stephen Davies on 9,544 in second.
Labour's Christina Rees also held on to Neath, Geraint Davies retained Swansea West and Stephen Kinnock kept Aberavon.
Meanwhile, the Conservatives' Simon Hart held on to Carmarthenshire West and Pembrokeshire South with 46.8% of the vote, and former Welsh Secretary Stephen Crabb retained Preseli Pembrokeshire by just 314 votes for the Tories.
Plaid Cymru's Jonathan Edwards retained Carmarthen East and Dinefwr with 16,127, ahead of Labour's David Darkin on 12,219.
Ms Antoniazzi said she though the key moment for the Labour campaign was when Prime Minister Theresa May "did a U-turn" on the Tories' social care policy.
"But also we have a strong manifesto and moving forward, on the doorstep that's what we were hearing," she added.
Mr Crabb said: "The motivations for doing this election were entirely right and proper, to strengthen the position of the United Kingdom before going into what will prove to be the most difficult set of international negotiations we've faced since the Second World War.
"Clearly something has gone wrong because the country has wanted to talk about other issues at this election time.
"They wanted to raise other concerns and there are a whole lot of new voters who were less concerned about Brexit and more concerned about issues to do with quality of life and their economic security into the future."
Stephen Kinnock, re-elected in Aberavon, said Labour had presented "radical but realistic policies" and common sense which reached out into the centre ground to appeal to voters.
He said Jeremy Corbyn had shown leadership and judgement in the manifesto put forward.

19 April 2017 Last updated at 17:30 BST
Maureen Leathley was a prima ballerina who toured the country with operatic companies.
Ms Leathley said the movement and the music takes her "to another world".

AMs are not meant to use assembly facilities for party-political campaigning.
But in March, South Wales Central AM Neil McEvoy discussed the campaign at a press conference held in an assembly briefing room.
Mr McEvoy accepted that he was in breach of the AM's code of conduct.
The standards committee has recommended to the assembly that Mr McEvoy be censured for the breach - a formal reprimand.
Their conclusion follows an investigation by the standards commissioner Sir Roderick Evans who said Mr McEvoy "failed to comply" with the rules on 14 March.
The press conference was held while Mr McEvoy was suspended from his party group in March - a suspension that was later lifted.
In a statement, Mr McEvoy said he distributed copies of a document at the press conference which contained seven policies relevant to the local elections, saying they were relevant to his suspension.
He said: "This was not appropriate. I accept that it was in breach of the code of conduct."
A Plaid Cymru spokeswoman said: "This is a matter for the individual member who apologised and we are pleased that this matter has been resolved."
Labour has won back Gower from the Conservatives, a seat the party won by 27 votes in 2015.
[NEXT_CONCEPT]
A 91-year-old woman from Hull is still dancing - 79 years after she began ballet classes.
[NEXT_CONCEPT]
A Plaid Cymru AM has apologised for discussing his party's council election campaign at a press conference in the Senedd building.