The UK's Conservative Party won a crushing victory in the northern England town of Hartlepool, breaking Labour's decades-long hold on the seat and strengthening Prime Minister Boris Johnson's grip on working-class areas.
Tory candidate Jill Mortimer defeated Labour's Paul Williams by 15,529 votes to 8,589.
Prime Minister Boris Johnson tied the party's strong result to Brexit on a visit to Hartlepool on Friday.
"The public want politicians to get on with focusing on their needs and their priorities," he said.
"This is a place that voted for Brexit. We've got Brexit done, and then we're able to do other things."
One Labour MP, Khalid Mahmood, laid into his leader. "My view is simple: in the past decade, Labour has lost touch with ordinary British people."
The loss is a blow to Labour leader Sir Keir Starmer, who faced his first electoral test since promising to transform the party in the wake of its heavy general election defeat in 2019.
"I am bitterly disappointed in the results and I take full responsibility for the result and I will take full responsibility for fixing things," he said.
"We have changed as a party but we haven't set out a strong enough case to the country, very often we have been talking to ourselves instead of to the country and we've lost the trust of working people, particularly in places like Hartlepool. I intend to do whatever is necessary to fix that."
Ms Mortimer’s win in Hartlepool, which had voted Labour since the seat's creation in 1974, shows support for the Conservatives is resilient despite Mr Johnson's early handling of the pandemic and a series of questions over his integrity.
The result means another brick in Labour's once-impregnable "red wall" of heartland seats has crumbled.
"Labour have taken people in Hartlepool for granted for too long," Ms Mortimer said in her victory speech.
“People voted for positive change, for jobs and investment.”
It is rare for the ruling party in the UK to gain seats from the opposition at a by-election.
The vote was among the first of a number of election results expected over the coming days, with ballots being cast in England, Scotland and Wales.
Hartlepool was the only UK Parliament seat up for grabs in the "Super Thursday" votes.
Because of the pandemic, two years' of local elections were held across Britain in a single day, including for 143 English councils, the Scottish and Welsh parliaments and the mayor of London.
Mr Starmer is likely to face intense pressure from within his own party if results like Hartlepool are replicated across the board.
Early results in council contests appeared to show voters deserting Labour, with the Tories so far seizing Northumberland, Harlow, Redditch, Dudley and Nuneaton and Bedworth. Labour has won the mayoral contest in Doncaster.
Hartlepool is one of the UK’s strongest Brexit-supporting constituencies, with 70 per cent voting to leave the EU in 2016, but the seat was retained by Labour at the last general election, largely thanks to the Brexit Party splitting the vote.
The result continues the trend set by Mr Johnson in 2019 when he struck directly at Labour's traditional heartlands, the red wall areas of northern and central England, to win a commanding majority.
'Crushing', 'shattering' and 'heartbreaking' for Labour
Mr Johnson's stocks rose in recent months thanks to the success of the vaccine programme, with more than half of Britain's adult population having received a first dose. The end of the UK's prolonged departure from the EU also boosted his party's standing in Hartlepool.
Senior Labour politicians suggested there were deeper issues at play in Hartlepool than Brexit.
Dianne Abbott, a close ally of former Labour leader Jeremy Corbyn and MP for Hackney North, said the result was crushing.
"Not possible to blame Jeremy Corbyn for this result," she said.
"Labour won the seat twice under his leadership. Keir Starmer must think again about his strategy."
Steve Reed, Labour's communities spokesman, said "the pace of change in Labour has not been fast enough".
"There’s no hiding from the fact this is a shattering result for Labour, absolutely shattering," he said.
"For a town like Hartlepool, which has been Labour for half a century and is now in Conservative hands is heartbreaking for anyone who is Labour. We have a breach of trust between too much of the British electorate and the Labour Party, and we haven’t done enough to repair it over this past year."
Peter Mandelson, a former Hartlepool MP, said "the two Cs - Covid and Corbyn" were the main reasons for the party's stinging loss in the seat.
"(Covid) has in a sense frozen politics - nobody was interested in anything but Covid and I don’t blame them," he said.
"It took away any issue to hang the campaign on. People frankly just want to get through the pandemic, to rally around the government's vaccine rollout and join in a sense of national unity."
Former Shadow Chancellor John McDonnell suggested the party lacked detailed policies.
"We must never again send our candidates into an election campaign almost naked, without a policy programme, without a clear view on what sort of society you want to create," he said.
A Conservative win in a traditional Labour seat like Hartlepool would have been unthinkable a decade ago.
Mr Starmer made no comment to reporters outside his London home on Friday.
However, he had already played down expectations for Labour in the lead-up to polling day.
"I never thought we would climb the mountain we have to climb in just one year. We've got to rebuild into the next general election – that is the task in hand," he said.
Results on the election in Scotland are expected later on Friday and Saturday.
The contest is being closely watched as the result could prove pivotal to Scottish First Minister Nicola Sturgeon's push for a second independence referendum.
An outright victory for Ms Sturgeon would make her calls for a second vote on the future of the UK hard for Mr Johnson to ignore.
Asked about what it would mean if the pro-independence Scottish National Party won a majority, the prime minister said: "Let's see what happens. I don't think people want much more constitutional wrangling right now."