Nicola Sturgeon has said there's "no place" in the SNP for people who protest about "the English" being in Scotland.
The First Minister condemned independence supporters who carry banners demanding "England get out of Scotland" and said that she did not "want them in the SNP".
Speaking at the Edinburgh Festival Fringe, where she was interviewed by TV political comedian Matt Forde, she was asked about whether she worried she was inspiring people who held anti-English sentiments.
Mr Forde raised the issue of the "guy down the Royal Mile with the banner", after Ms Sturgeon said she believed her nationalism, was "on another spectrum altogether" from that of "far right, racist, insular movements in other parts of the world".
The First Minister admitted that "any party, any movement" could "attract people who don't want.. who will see, or choose to see, something in what you stand for that it's not."
She added: "The banner you talk about, that person with that banner does not speak for the SNP and that sentiment has no place in the kind of Scotland I want us to be and think we are.
"I think you can't get to a situation, in any party, that you can say with certainty that you never attract the wrong kind of person. But you can be vehement and resolute in calling it out and saying very clearly if that's your opinion you don't belong in this party, we don't want you.
"And people who put up banners like that I don't want them in the SNP, I'm sorry if that offends them but I don't want them."
Ms Sturgeon went on to reference comments by Scotland's makar, Jackie Kay, about Scotland needing to “grow up” and take more responsibility for the treatment of black and ethnic minorities.
She said: "What she was saying is that for all the progress we've made Scotland still has a lot of work to do on tackling racism and equality. She got a lot of criticism on line from people who just would not accept that there was anything wrong with Scotland and frankly we should never be complacent about racism and bigotry - we've always got to make sure that we are living up to the ideals we have of Scotland.
"And most important thing for someone in my position is not to pretend that my party will never attract anybody of those opinions but to be clear we will never make the SNP a comfortable and welcoming place for them."
Asked if she would want to rename the SNP to distance it from "nationalism" Ms Sturgeon said that after 90 years it was a bit late, but did admit that she had "a problem" with the "N" word.
"I'm 100 per cent comfortable with what my party stands for," she said. "But in an international context, and for some people in the UK as well, when you say the word nationalist you don't think of a civic progressive, outward, open movement likes the Scottish independence movement, you think of the far right, racist, insular movements we see in other parts of the world and we couldn't be more different to that.
"A lot of the regimes called nationalist today are not countries striving to be independent, because often they already are, but are based on some kind of racial exceptionalism, or superiority often very illiberal and oppressive of minorities, and Scottish independence is not just at the other end of the spectrum of that, but on another spectrum altogether
"The SNP today is and I think I can say it without fear of justifiable contradiction, the most pro immigration party in the UK which is not what you would expect of a nationalist party, so my nationalism is rooted in a desire to make the country I live in as good as it can be.
"I don't care where yo come from if you come to Scotland and consider yourself Scottish that's fine by me and I want more people to come to Scotland and consider themselves Scottish, and to see Scotland has something to offer to the wider world."
Mr Forde went on to raise the subject of "cybernats" and the impact they had on the SNP and if the party would be more "rigorous in calling them out" in any future Scottish independence referendum.
Ms Sturgeon said: "I think we are. I call things out when I see them and it's appropriate to do that.
"But I think there's an unrealistic expectation given social media and how people operate online that any leader of any party can police that. I'm not responsible for everything people say on Twitter - thank god.
"But it cuts both ways. I try not to look at it but some of the abuse I get on Twitter would literally make your hair curl, its horrible misogynist, really filthy disgusting stuff. And women across all parties get that, so we should always call that out.
"I genuinely don't spend any time looking at that stuff. Occasionally I'll see things and say that's a bit much but it would drive you bonkers, particularly in a position like mine where there's just so much comes... if I was to stop and actually go into some of that it would drive you crazy and it would not be healthy.
"In a position of political leadership You've got to try and keep a sense of equilibrium. One of the big dangers of social media that it doesn't just distort political debate but if you're not careful will distort your own priorities, the judgements you make about how you spend your time, what you choose to prioritise, the positions you take and the risks of that are obvious, so maintaining a sense of distance from that is very important."
She added: "There's a much bigger debate, not confined to Scotland, about how social media is distorting our political debate and not in a good way and I don't have all the answers to that but it's a big challenge for everybody."
She was also quizzed about her meeting with Boris Johnson in Bute House, which she said contained a lot of "bluster but not much detail". Asked what her relationship is like with Jeremy Corbyn, she appeared lost for words.
"I don't know. I genuinely... so I've not... I'm finding it hard not to... I've not had that many meetings with Jeremy Corbyn," she said. "Ian Blackford leads most of the day to day interaction with other leaders at West he does that public service on behalf of all of us.
"I've had a handful of meetings with Jeremy Corbyn. I find it's a bit hit or miss as to how much of the detail he's prepared to engage with.
"I am still not convinced that he actually wants the UK not to leave the EU. He would deny this but my strong suspicion is that though he says he voted Remain, I suspect he would quite like to see the UK out of the EU so he's been half-hearted in trying to find a way out of this mess."
She added: "I think there's been an appalling lack of leadership from his party on Brexit and actually, if we do crash out on 31 October without a deal, he will share a significant chunk of the responsibility, in my view, for failing to get off the fence.
"It's not an easy one for Labour many of their constituencies voted Leave, others voted Remain, but sometimes in big issues in politics you have to decide which side you're on. Apart from it being a woeful lack of leadership the results of the European elections for Labour, UK wide but particularly in Scotland, show the price you pay for equivocating and trying to keep both sides happy.
"This is a crisis the UK is facing - it's one of the biggest decisions and issues of this generation - say which blinking side of it you're on. Take a position for goodness sake, it's very frustrating that he's not been able to do that."