On a visit to Newport to congratulate by-election winner Ruth Jones, Jeremy Corbyn said that Labour had managed to "unite people, whether they voted Leave or Remain, against a Government that is impoverishing so many people".
Ruth Jones won the Newport West by-election, retaining the seat held by Paul Flynn until his death earlier this year.
Ms Jones, who is from Newport originally, was the favourite to succeed Mr Flynn, who held the Newport West seat for 32 years.
A former president of the Wales Trade Union Congress (TUC), Ms Jones was defeated at two previous parliamentary elections for Monmouth in 2015 and 2017 by Conservative David Davies.
After her victory was announced, she paid tribute to "our friend" Paul Flynn.
The Labour Leader visited Newport West earlier and credited the party's victory with a campaign focused on opposition to austerity.
Labour won with a majority of 1,951. The full results were:
Ruth Jones will join Labour as opposition in the House of Commons.
The mother-of-two worked in the NHS as a physiotherapist for more than thirty years.
She was President of the Wales Trades Union Congress (TUC) in 2007. She said ensuring people "get a fair deal" and can "rely on the vital services that are so important to families across Newport" will be her priority as MP.
The turnout of 37.1% in Newport West is significantly down on 2017, when 67.6% of the electorate used their vote.
With a majority of 1,951 Ruth Jones' majority is significantly down on Mr Flynn's majority since 2017 of 5,658 - a change that is largely due to low turnout.
The by-election was called after the veteran Labour MP Paul Flynn died following an illness earlier this year.
In 2017, Paul Flynn increased his majority and won more than 52% of all votes cast.
On Thursday evening, after the polls closed at 10:00pm, ballot boxes started to arrive at the count.
The result was announced just before 1:30am on Friday morning.
The city has traditionally been a stronghold for Labour but the result will be watched as an indication of how support for Jeremy Corbyn's party has been affected by Brexit, which Newport voted for by 56% to 44%.
The poll comes just days after Mr Corbyn and Theresa May met face-to-face at Westminster for talks on a Brexit compromise.
Reacting to the win, Ruth Jones told ITV Wales News she will "reach out" to people in Newport West who did not vote in the by-election.
The Conservative candidate Matthew Evans had hoped to improve on his party's performance at the 2017 general election, when the Tories finished second.
Although the party remained in second place, its vote share fell by 8%.
Mr Evans is a councillor for the Allt-yr-yn ward in Newport Council and opposition leader, having served as mayor of the city between 2008 and 2012.
The highest profile name who took part in the contest was former-Tory minister Neil Hamilton, who was hoping to return to the Commons more than two decades after being ousted as an MP. Mr Hamilton was involved in the cash-for-questions scandal in the 1997 general election.
Mr Hamilton, now Ukip's leader in Wales, was hoping to benefit from the Brexit effect in the Leave-voting city and a low turnout.
Ukip's vote share of 8.6% was up more than 6% on 2017, and was the party's best result in the constituency since the 2015 General Election, when they gained more than 18% of the vote.
Ruth Jones is expected to take up her seat in the House of Commons before the next meaningful vote on Brexit next week.