UK Labour faces the same kind of electoral slaughter as the party in Scotland unless it reconnects with its core voters, Kezia Dugdale has warned.

The Scottish Labour leader said her party had been “the canary down the mine, in terms of losing faith in working class communities across the country”.

Speaking about the Tory win in the Copeland byelection last week, she told BBC Sunday Politics that worse lay ahead if Labour did not learn from the example of Scotland.

The Scottish party fell to a single MP in 2015 and to third place at Holyrood in 2016 after alienating many of its voters during the independence referendum.

She said: “In many respects what is happening in the North of England is what happened to the Scottish Labour party two years ago.

“We were the canary down the mine, so to speak, in terms of losing the faith of working class communities across the country.

“These are very difficult times for the Scottish Labour party and indeed the UK Labour family.

She added: “I’ve never shied away from that reality but I have a plan in place to turn things around. It is going to take time though.”

Ms Dugdale was also forced to defend London Mayor Sadiq Khan, who provoked a storm on Saturday by bracketing Scottish nationalism with racism, saying there was “no difference” between those dividing people into Scottish and English, and those dividing people on race.

After being condemned by Nicola Sturgeon and other SNP ministers, Mr Khan later inserted a caveat into his conference speech denying he was calling the SNP racist or bigoted

Ms Dugdale was repeatedly challenged to distance herself from Mr Khan’s “absurd claim”.

She said: “Well I think Sadiq Kahn was very clear yesterday that he wasn’t accusing the SNP of racism. What he was saying very clearly, though, was that nationalism by its very nature divides people, divides communities... I’m fed up living in a divided and fractured country, a divided and fractured society."

She added: “I have never suggested and never would suggest that the SNP are an inherently racist party. That does our politics a disservice... He didn’t say it.”

"What he did say however... is that nationalism is divisive. He is saying nationalism is divisive politics and that there is an alternative.

“He was very clear that he was talking about divided politics. There’s a huge appetite the length and breadth of the county to end that type of divisive politics.”