Following the Selby and Ainsty victory, Labour leader Sir Keir Starmer said: “This is a historic result that shows that people are looking at Labour and seeing a changed party that is focused entirely on the priorities of working people with an ambitious, practical plan to deliver.

“Keir Mather will be a fantastic MP who will deliver the fresh start Selby and Ainsty deserves.

“It is clear just how powerful the demand for change is. Voters put their trust in us — many for the first time.

“After 13 years of Tory chaos, only Labour can give the country its hope, its optimism and its future back.”

In his speech after being declared the winner of the Selby & Ainsty by-election, Labour’s Keir Mather said he “understood the enormity of what has just happened”.

He said: “We have rewritten the rules on where Labour can win. People have opened their doors to us and embraced our positive vision for the future.

“The people of Selby & Ainsty have sent a clear message. For too long, Conservatives up here and in Westminster have failed us, and today that changes.

“Over the past few months, speaking to hundreds of people on the doorstep, I’ve encountered so much hardship. Hardship made worse by 13 years of negligence and complacency from the Conservatives.”

After Keir Mather’s speech, defeated Conservative candidate Claire Holmes left Selby Leisure Centre, where the count was being held, without talking to reporters.