Mrs Jones had been the clear favourite to succeed Mr Flynn, who held the Newport West seat for 32 years, winning with a majority of 5,658 and more than half the vote in 2017.

Voter turnout was 37.1%, down from 67.5% in the 2017 general election, with parties blaming poor weather including rain and hail on Thursday.

Mrs Jones, who campaigned for Remain in the lead-up to the EU referendum, said the country should not accept a “damaging Tory Brexit” or a no-deal outcome.

Ukip leader in Wales Mr Hamilton, the highest profile name taking part in the contest, sought a return to the Commons more than two decades after being ousted as an MP in the 1997 general election following his involvement in the cash-for-questions scandal.

Mr Hamilton had hoped to benefit from the Brexit effect in the Leave-voting city and campaigned saying the by-election would provide a chance to send a clear message to Westminster over its handling of the UK’s exit from the EU.

After the result, he said: “To nearly quadruple our vote, I regard a success in itself even though we didn’t win the election.

“Brexit is the issue of the day and fundamentally that is itself the biggest issue of the day because it’s all about democracy, about whether we should be able to elect the people that make our laws and rules and regulations.

“Ultimately this is what it’s all about. It’s really whether you, the people, are the ones the politicians obey or the other way around. That is an issue that certainly isn’t going to go away, and Ukip isn’t going to go away.

“I regard this as the start of a new era for my part and I look forward to the next election, whenever that may come.”

Conservative candidate Matthew Evans took 7,357 votes, and saw a swing from Labour to the Tories of 2.36%.

Mr Evans also paid tribute to Mr Flynn, saying: “He served our city for over 40 years with passion and commitment. I hope Ruth will look to Paul’s example as a dedicated local MP.”

He added that he had “never seen such anger” on the doorstep regarding Brexit.

Mr Evans said: “I have never known such anger and frustration which I share and has been reflected in the turnout. People just want clarity and I’ve seen no appetite for another referendum or a general election.”

Mrs Jones is a former president of the Wales Trade Union Congress (TUC) and was defeated at two previous parliamentary elections for Monmouth in 2015 and 2017 by Conservative David Davies.

Labour leader Jeremy Corbyn welcomed the victory, stating: “Ruth will be a fantastic successor to Paul Flynn and will take up the tireless work he carried out for this community.

“Tonight’s result sends a clear message that the people of Newport and Wales are fed up of austerity which has robbed the Welsh economy of £1 billion through needless cuts, and shows support for Labour’s alternative.”