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 opposition Labour Party.
The by-elections were one of the last electoral tests before a national election expected next year and were seen as an indicator of the two main parties' prospects at a time when voters are struggling with high inflation, strikes and rising mortgage rates.
Sunak could draw some relief as his party narrowly avoided losing all three seats. But the problems he faces were highlighted by the loss of the formerly safe Conservative parliamentary seat of Selby and Ainsty, where Labour overturned the biggest Conservative majority at a by-election since World War Two.
Labour leader Keir Starmer said the victory showed "just how powerful the demand for change is".
The Conservatives suffered a crushing loss in another vote but retained Johnson's former seat of Uxbridge and South Ruislip by fewer than 500 votes to ensure Sunak avoided becoming the first British leader to lose three by-elections on a single day in more than half a century.
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 Johnson to resign, and economic turmoil prompted his successor, Liz Truss, to quit after just six weeks.
He is expected to reshuffle his senior ministers soon to pick his team to fight the next general election.
With stubbornly high inflation, economic stagnation, rising 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 seats.
Sunak's Conservatives are trailing Labour by 20 points in national opinion polls, which suggests the governing party will struggle to win a fifth consecutive general election.
But Labour's loss in Uxbridge shows its lead in the polls may not translate into to a clear parliamentary majority at the next general election.
John Curtice, Britain's best-known pollster, said based on Labour's performance in Uxbridge, the most likely outcome at the next general election is a hung parliament.
"The tide is still a long way out for the Conservatives and they still have an awful long way to go before they look as though they might have a chance of being able to retain power after the next general election," he told the BBC.
More about: