ARTICLE AD BOX
By Sam Francis
Political reporter, BBC News
Sir Keir Starmer says Labour can now win anywhere - but Rishi Sunak insists his party is still in the game after three very different by-elections.
Labour secured a massive 23.7% swing from the Tories in Selby, with its 25-year-old candidate Keir Mather winning won by 4,000 votes.
The Lib Dems overturned a big Tory majority to take Somerset and Frome.
But in Uxbridge and South Ruislip, the Tories narrowly held on to Boris Johnson's old seat.
The Labour leadership blamed their failure to take Uxbridge and South Ruislip by 495 votes on the expansion of the Ultra Low Emission Zone (Ulez)- a charge for the most polluting vehicles - to outer London.
The winning Conservative candidate Steve Tuckwell said Sadiq Khan's "damaging and costly Ulez policy" had lost Labour the seat.
Sir Keir Starmer said Labour's Mayor of London needed to "reflect" on the policy, but stopped short of saying it should be scrapped.
Prime Minister Rishi Sunak also attributed the Conservative win to voter anger over Ulez - and claimed the result showed the next general election was not a "done deal".
Mr Sunak said: "When people are confronted with a real choice, a choice on a matter of substance, they vote Conservative.
"That's what the general election is going to be about."
But overall, the trio of by-election results show what the opinion polls have suggested for months - Mr Sunak faces a deep challenge at that election, which is expected to take place next year.
Having three by-elections on the same night is unusual, especially for a prime minister less than a year into the job.
The last time Labour secured a by-election swing as large as it did in Selby and Ainsty was in the 1990s - which ended with the Conservatives suffering a landslide defeat.
Born in 1998, Keir Mather is the first since that landslide election.
At 25, Mr Mather, becomes the youngest MP in the House of Commons after overturning a 20,000 Conservative majority.
Celebrating the victory in the rural North Yorkshire constituency on Friday morning, Sir Keir claimed it represented a "cry for change" from voters.
He said it was a "vindication" of the changes he had made to the party since taking over as leader from Jeremy Corbyn, showing Labour "can win anywhere, including places that were Tory strongholds."
"I know people have put their trust in us, and we will deliver on that trust," he added.
The Labour leader has ditched many of the policies promoted by Mr Corbyn, who has been expelled from the party along with other left wing figures.
On Friday, the chair of Uxbridge's Labour party resigned with a parting shot at Sir Keir.
David Williams, who said his resignation was "nothing to do" with the by-election result, told the BBC he was unhappy with Sir Keir's leadership and the party's "move to the right."
It was a good night for the Liberal Democrats, who overturned a Tory majority of 19,000 in Somerton and Frome in Somerset.
The party leader Sir Ed Davey said it showed voters were uniting to defeat the Conservatives.
Sarah Dykes, a local business owner and sheep farmer, becomes the tenth female Lib Dem MP - meaning there are now twice as many females as males in the Commons cohort.
Speaking after her election, she promised to be an "active, hard-working champion".