The ruling Conservatives on Friday (21) held the former seat of ex-prime minister Boris Johnson but saw hefty majorities in two other seats blown away as scandals and high inflation took their toll.
Rishi Sunak was expected to become the first prime minister to lose three parliamentary seats on one day, but was spared that humiliation due to a narrow victory in the west London seat of Uxbridge and South Ruislip.
While that result may have offered the embattled Sunak some relief, the wiping out of his party's 19,000 majority in the Somerton and Frome seat and its 20,000 majority in the Selby and Ainsty constituency will come as hammer blows ahead of an expected general election next year.
The main opposition Labour party took the northern England seat of Selby and Ainsty by 16,456 votes to 12,295, in the process overturning its biggest deficit at a by-election since World War Two.
Labour leader Keir Starmer tweeted that "last night, Selby and Ainsty made history.
"This incredible result shows how powerful the demand for change is," he added.
In the southwestern England seat of Somerton and Frome, the Liberal Democrats won by 21,187 to 10,179, with winning candidate Sarah Dyke celebrating a "stunning and historic victory" and taking aim at the "woeful government".
The Tories had also been expected to lose Johnson's former seat of Uxbridge and South Ruislip, but won by 13,965 votes to 13,470, delivering a blow to Starmer and London's Labour mayor Sadiq Khan.
Winning candidate Steve Tuckwell said the "number one" issue had been Khan's expansion of a tax on polluting vehicles to outer London boroughs.
He warned Labour MPs in similar seats "will now be panicking" and the result is likely to spark conversations between Starmer and Khan.
'Local issues'
However, heavy defeats in the other two contests leave Sunak increasingly vulnerable ahead of next year's likely general election, with parliament's six-week break providing welcome relief.
The Labour party is currently enjoying double-digit poll leads and is poised to retake power for the first time in over a decade.
It has now won six by-elections since March last year, with two of those seats captured from the Tories.
The Uxbridge and South Ruislip contest was triggered after the scandal-tarred Johnson resigned as an MP last month.
He quit after learning that a cross-party parliamentary committee had concluded he deliberately lied to lawmakers about lockdown-breaking parties during the Covid pandemic, and recommended a 90-day suspension.
After the by-election result, Johnson tweeted: "Fantastic news from Uxbridge. This shows the Conservatives can win in London and around the country."
Johnson's ally Nigel Adams quit shortly afterwards after failing to be nominated for a peerage, triggering the Selby and Ainsty by-election.
The third vote in Somerton and Frome was called after its Tory MP David Warburton stood down following an admission of cocaine use.
Sunak, who has not been visible on the campaign trail, sought to project a business-as-usual image on Thursday but privately briefed backbench MPs to expect the worst.
Sunak struggles
Sunak became prime minister following the disastrous 44-day tenure of predecessor Liz Truss and initially succeeded in stabilising financial markets panicked by her radical tax-slashing agenda.
But the 43-year-old former chancellor of exchequer has struggled to reverse his party's declining fortunes, which first set in during the so-called "Partygate" scandal under Johnson.
Sunak's turnaround efforts have in part been hobbled by persistently high inflation, which in recent months has spooked the markets once again.
With interest rates at their highest in 15 years, pushing mortgage and other borrowing costs ever higher, the worst cost-of-living crisis in a generation is showing few signs of abating.
Sunak kicked off the year by making five key vows to voters, including halving inflation, growing the economy and cutting waiting times at the overstretched National Health Service.
He has made little headway on most of the pledges, and there are persistent fears the UK will tip into recession this year as the high interest rates constrain spending.
Sunak's net favourability has fallen to its lowest level (-40) since he entered Downing Street, with two-thirds of Britons saying they have an unfavourable view of him, according to YouGov.
(AFP)
Respite for Sunak as Tories avert wipeout
Conservatives retain Uxbridge and South Ruislip but lose two other seats in by-election