Labour’s victor in the Newport West by-election said the result showed people were sick of austerity.
The battle for the Commons seat saw turnout slump with Labour’s Ruth Jones taking 9,308 votes, giving her a majority of 1,951 over the Tories.
The contest was triggered by the death of veteran MP Paul Flynn and came against the backdrop of Brexit battles at Westminster.
“There have been many tributes to him over the weeks, but one saying stood out to me: ‘Everyone knew someone helped by Paul Flynn’. These words have been an inspiration to me during this campaign.”
Mrs Jones added: “Who knows what the next few days, weeks and months will bring. But what I do know is that people have had enough after a decade of austerity.”
The city has long been a Labour stronghold and voted Leave by a margin of 56% to 44% in the 2016 in-out referendum.
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.
“The trust in politicians is very low at the moment and I recognise that.
“They say get on with it, we need to make sure we bring this to a close now, it’s gone on long enough.”
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 over the cash-for-questions scandal.
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.
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.”