Labour’s victory comes as a blow to Mr Farage’s ambitions, as his recently-formed party sought to build on its strong European election performance to win a foothold in parliament.
The constituency, which voted overwhelmingly for Brexit in 2016, had been squarely in the party’s sights but appears to have been defeated by Labour’s more established ground campaign.
It was also a tough night for the Conservatives who slumped to third place, in a blow to Theresa May on her final day as Tory leader.
Lisa Forbes won the seat with 10,484 votes to the Brexit Party’s 9,801, with the Tories in third on 7,243 votes, in a seat which has traditionally been a Conservative-Labour marginal.
In her victory address, Ms Forbes said it was clear that the “politics of hope can win regardless of the odds”.
“Despite the differing opinions across our city, the fact that the Brexit Party have been rejected here in Peterborough shows that the politics of division will not win,’’ she said.
Ms Forbes had faced controversy days before the poll when she had to apologise for endorsing an antisemitic Facebook post that claimed Theresa May had a “Zionist Slave Masters agenda”.
The then-candidate said it included a video of children praying following the Christchurch attacks.
Labour’s vote share had nonetheless fallen by more than 17 percentage points from the 2017 general election, while that of the Conservatives was down by more than 25 percentage points.
Brexit Party candidate Mike Greene, a businessman best known for appearing on Channel 4’s Secret Millionaire, had been the bookies’ favourites to win the seat
Labour’s Lisa Forbes after winning Peterborough by-election: ‘the fact the Brexit Party have been rejected here in Peterborough shows that the politics of division will not win’ pic.twitter.com/ylgAapPXix— Sam Russell (@SamRussellPA)June 7, 2019
Apparently aware of impending defeat, Mr Farage left the count before the result was announced.
A Brexit Party spokesman hailed it as a “remarkable result”, adding: “If we can come so close in our 201st target seat, no seat is safe.
“We’re very proud of Mike Greene and our supporters who worked so hard. Thanks to the people of Peterborough who voted for us – we promise you that we’re here to stay!”
Labour leader Jeremy Corbyn hailed the result as a sign that his party was trusted by voters despite the criticism it has failed to take a clear line on Brexit.
Congratulating his candidate ”on a great win and a people powered campaign”, he said that voters had “shown clear support for Labour’s programme to end austerity and invest in services and communities, rejecting a decade of Tory cuts and their disastrous handling of Brexit.
“In this key seat, the Conservatives have been pushed to the margins.”
He added: “This result shows that in spite of the divisions and deadlock over Brexit, when it comes to a vote on the issues that directly affect people’s lives, Labour’s case for real change has strong support across the country.”
Labour Party chairman Ian Lavery said he was “chuffed to bits” with the result.
He tweeted: “Congratulations to the fabulous LisaForbes – Great team effort UKLabour members supporters & officials. Increased majority despite being written off by the many not the few. Chuffed to bits. Simple.”
The by-election was called after Peterborough’s previous MP Fiona Onasanya was forced out after she was jailed for lying about a speeding offence.
Onasanya was elected as a Labour MP in 2017 with a wafer thin majority of 607 but she was kicked out of the party after she was sentenced.
Local Tory activists expressed frustration that they were unable to take advantage of Labour’s difficulties due to ongoing Brexit chaos.
Wayne Fitzgerald, chairman of the Peterborough Conservative Association, said it was now essential the party committed to taking Britain out of the EU, even if it meant no deal.
“Parliamentarians in Westminster are against the will of the people,” he told Sky News.
“The Conservatives must de-select every MP who will not accept a WTO (World Trade Organisation) Brexit if it comes to that.
“If Boris or whoever is leader doesn’t do that, Mr Farage will sweep to 450 seats in the next general election.”