Labour have won the Wakefield by-election, taking back the seat which they lost to the Conservatives in 2019.
Simon Lightwood, an NHS worker, became the new MP, convincingly defeating Tory candidate Nadeem Ahmed, in a result announced at Wakefield's Thornes Park Athletics Stadium.
He won 13,166 votes, 47.94% of those cast – a majority of 4,925 over Mr Ahmed – and overturning a Conservative majority of more than 3,000 from 2019.
Afterwards Mr Lightwood said: "The next Labour government is born in Wakefield tonight."
He said the electorate had sent a message to Boris Johnson. "They have said, unreservedly: Boris Johnson, your contempt for this country is no longer tolerated," he said.
He went on to tell reporters that Labour was "rebuilding the red wall" and that the biggest issue on the doorstep throughout the campaign had been the cost of living crisis.
Labour leader Sir Keir Starmer said: “Wakefield has shown the country has lost confidence in the Tories.“This result is a clear judgment on a Conservative Party that has run out of energy and ideas. Britain deserves better.”
Mr Ahmed left the count without speaking to reporters and declining to answer questions about whether Boris Johnson was responsible for the defeat.
The result in full
Simon Lightwood (Lab) 13,166 (47.94%, +8.13%)
Nadeem Ahmed (Con) 8,241 (30.00%, -17.26%)
Akef Akbar (Ind) 2,090 (7.61%, +6.60%)
David Herdson (Yorkshire) 1,182 (4.30%, +2.38%)
Ashley Routh (Green) 587 (2.14%)
Chris Walsh (Reform) 513 (1.87%)
Jamie Needle (LD) 508 (1.85%, -2.09%)
Ashlea Simon (Britain 1st) 311 (1.13%)
Mick Dodgson (FA) 187 (0.68%)
Sir Archibald Stanton Earl 'Eaton (Loony) 171 (0.62%)
Paul Bickerdike (CPA) 144 (0.52%)
Therese Hirst (Eng Dem) 135 (0.49%)
Jordan Gaskell (UKIP) 124 (0.45%)
Christopher Jones (NIP) 84 (0.31%)
Jayda Fransen (Ind) 23 (0.08%)
Lab maj 4,925 (17.93%)
12.69% swing Con to Lab.
The by-election was triggered by the resignation of the previous MP, Imran Ahmad Khan.
Khan's victory in 2019 was the first time in more than 87 years that the Conservatives had held Wakefield.
But he was forced to quit after being convicted of sexually assaulting a teenage boy.
Mr Lightwood, aged 41 and originally from South Shields, South Tyneside, worked as a staffer for the ex-Labour MP Mary Creagh and campaigned on a platform of helping people through the cost of living crisis, fixing "our broken transport system" and improving public safety.
He has lived in Wakefield for the last 10 years, although his selection angered some in the local Labour Party who argued he should not represent the city because he was not born and bred there.
The by-election in Wakefield was one of two held on the same day that were seen as a key test of Prime Minister Boris Johnson's leadership.
The Conservatives also lost the seat of Tiverton and Honiton, Devon, in a by-election triggered after former MP Neil Parish stepped down from his role when he admitted to watching pornography on his phone in the Houses of Parliament.
The Liberal Democrats won the seat, overturning a huge 24,000 Tory majority with a dramatic 30% swing.
Richard Foord, the new Lib Dem MP, used his acceptance speech to call for Mr Johnson to "go, and go now", claiming his victory had "sent a shockwave through British politics".