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.
Labour has won back Gower from the Conservatives, a seat the party won by 27 votes in 2015.