Nicola Sturgeon has waded into a transphobia row that is in danger of splitting the SNP.

The SNP leader posted a video on Twitter on Wednesday night amid signs that significant numbers of young people are quitting the party because of the hostility of some members towards transgender people.

In the message, which she said “comes from my heart”, Sturgeon said: “It grieves me deeply that you’ve reached this conclusion after much soul searching because you consider at this stage the SNP not to be a safe, tolerant or welcoming place for trans people.”

The row centres on potential legislation that would make it easier for someone in Scotland to change their gender which has led to public splits in the SNP.

But the exodus by young activists appears to have been sparked by amendment to the Hate Crime bill to protect freedom of speech in the “discussion or criticism” of transgender identity.

The move has been welcomed by leading feminists in the SNP, including Joan McAlpine MSP who said “very vocal groups and individuals view any discussion as ‘threatening and abusive’ when it’s not at all.”

Joanna Cherry MP, another leading defender of women’s rights, has claimed on twitter to have been the focus of “renewed attempts from a nasty minority in my party to smear me”.

Kirsten Oswald, the deputy Westminster leader of the SNP, said no one should be subject to hostility and confirmed a number of younger people were leaving the party.

Speaking to the BBC Oswald appealed for respect across the divide.

She said: “ We need to be clear that there’s no place for transphobia, just as there is no place for racism or homophobia and we need to also be really clear that there is an issue here that we accept that.”

“We have to have respectful and sensible debate on on all issues and you know this is no different in terms of the importance of having that ability to, to have to be to have respectful debate but what there isn’t is any tolerance of transphobia, and people clearly have a concern.”