British Prime Minister Rishi Sunak's governing Conservatives lost two strategically important parliamentary seats on Friday but unexpectedly retained Boris Johnson's old constituency in a setback for the main opposition Labour Party.
The votes were one of the last electoral tests before a general election expected next year and had been seen as an indicator of the two main parties' prospects.
The Conservatives retained Johnson's former seat by fewer than 500 votes in a huge relief for Sunak who narrowly avoided becoming the first British leader to lose three by-elections on a single day in more than half a century ago.
Sunak, a former finance minister and investment banker, has tried to use his technocratic leadership to restore the Conservatives' credibility after a series of scandals last year forced Boris Johnson to resign, and economic turmoil forced his successor, Liz Truss, who quit after just six weeks.
With stubbornly high inflation, economic stagnation, rising taxes and mortgages rates, industrial unrest, and long waiting times to use the state-run health service, the Conservatives had been braced for the possibility of losing all three contests.
In a surprise result, the Conservative Party retained Uxbridge and South Ruislip seat after Johnson's shock decision to quit parliament last month after he was found to have made misleading statements over parties held in Downing Street during the coronavirus pandemic.
In his victory speech, former postman Steve Tuckwell, who won the seat, said his party's victory was because of local factors, pointing to the issue of London’s Labour mayor extending the ultra-low emission zone to include suburban areas such as Uxbridge.
The other results exposed the Conservatives vulnerabilities on two fronts: the loss of a rural seat in the north of England where it performed strongly in the past, and one in the southwest, a traditional stronghold.
Labour won the constituency of Selby and Ainsty from the Conservatives by 4,000 votes after an ally of Johnson resigned in solidarity. The party said overturning the majority of 20,137 from the last general election marks the biggest majority the party has overturned at a by-election since World War Two.
In Somerton and Frome in southwest England, the centrist Liberal Democrats managed to overturn a Conservative majority of 19,213 after a third member of parliament quit over allegations of sexual harassment and cocaine use.
John Curtice, Britain's best-known pollster, said based on Labour's performance the party is unlikely to win an outright majority at the next election.
Curtice said Labour's loss in Uxbridge shows the "potential fragility" of the party's lead in the polls while the Conservatives are vulnerable in southern areas.
The two main "political party leaders have been left with something to think about in the wake of these results", he said.