London Mayor Sadiq Khan has insisted that a trail of his address to the Scottish Labour conference in Perth was not accusing the SNP of being racists.
Part of his speech - posted on Twitter - implied there was "no difference" between nationalism and racism.
The tweeted extract prompted a strong response on social media including from Nicola Sturgeon.
Scotland's first minister described Mr Khan's intervention as "spectacularly ill-judged".
Using her Twitter handle, she said: "It is an insult to all those Scots who support independence for reasons of inclusion & social justice - the antithesis of what he says."
Before taking to the conference stage, Mr Khan told BBC Scotland's political editor Brian Taylor "of course I am not saying that the SNP are racists or bigots".
He went on to explain: "What I am saying is that the world is increasingly divided by Brexit result and the election of President Trump, with the rise of populist and narrow nationalist parties across the world, now is the time to come together, now is the time for unity, not a time for division or isolation."
During Mr Khan's speech, he reiterated that he was not calling the SNP racists or bigots.
He said: "With the world becoming an increasingly divided place. Brexit. President Trump. And the rise of populist and narrow nationalist parties around the world.
"Now's not the time to play on people's fears.
"Or to pit one part of our country - or one section of our society - against each other.
"In that respect there's no difference between those who try to divide us on the basis of whether we're English or Scottish, and those who try to divide us on the basis of our background, race or religion.
"Now of course I'm not saying that nationalists are somehow racist or bigoted - but now, more than ever - what we don't need is more division and separation.
"Conference, now's the time to build unity. To build a more United Kingdom. To ensure that no one is left behind and that everyone has the opportunity to succeed. To build an open and more inclusive economy."