A veteran campaigner for Scottish independence has accused so-called cybernats who subjected author JK Rowling to a tirade of internet abuse of “opening the door” to a possible MI5 dirty tricks campaign to scupper a Yes vote in the forthcoming referendum.

Former SNP deputy leader Jim Sillars claimed it was “naïve” to think that the security forces were not involved in seeking to influence the outcome of September’s ballot which could see the break-up of the UK.

He told The Independent that he was personally aware of one secret agent having arrived in Glasgow.

Download the new Independent Premium app Sharing the full story, not just the headlines

Mr Sillars said that those who posted the abusive comments – including one sent from a hacked charity Twitter feed - viciously lambasting Ms Rowling for her £1m donation to pro-union Better Together this week had meant to harm the independence cause. “I don’t know who did. Somebody did it that is inimical to the yes campaign,” he said.

This week a special advisor to First Minister Alex Salmond was forced to apologise after he made false claims about a mother-of-two who spoke at a Better Together rally. Clare Lally was later targeted by what she described as “keyboard warriors” who attacked her on social media.

In an open letter to cybernats, whom he described as “useful idiots” – the phrase deployed by Lenin to describe propagandists for a cause they did not understand - Mr Sillars said that online smears and insults had delivered a publicity coup for supporters of the status quo.

“Are you so naive, that you never think that perhaps MI5 and special branch are taking a role in this campaign? As their function is protection of the British State, they would not be doing their jobs if they were not. There was, and probably still is, a section in MI5 that dealt with the Scottish national movement, headed by Stella Rimington, who became Director General in 1992, and is now Dame Stella,” he wrote.

Mr Sillars also claimed that during the failed 1979 devolution vote, the US Consul in Edinburgh was “from the CIA stable”.

He added: “That was for a weak assembly, do you think that they will not be more engaged now that independence is on the agenda? Has it ever crossed your mind that by conducting a campaign of abuse, which plays into the hands of the No media, you are opening the Yes side to a dirty tricks campaign?”

Speaking later, Mr Sillars, who said he had worked with the security services during his political career, said: ”I know there was an MI5 guy arrived in Glasgow. I won’t tell you how or why I know it. I know when he came.”

He added that continuing internet abuse meant: “You open the door to MI5 to take a role that we wouldn’t know about and wouldn’t be able to identify.”

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

A spokesperson for Yes Scotland said: ‘We are not aware of the matters Mr Sillars refers to, and these are his own views.”

Yesterday First Minister Alex Salmond said pro-union comments made by Hillary Clinton which mirrored those of President Obama would boost the Yes vote

Mrs Clinton, a former US Secretary of State told BBC2’s Newsnight: “I would hate to have you lose Scotland” describing a split from Westminster as a “loss for both sides”.

Mr Salmond said: "I suspect that insofar as it is influential, it is helpful to the Yes side.

"I don't know if Hillary or the president of the United States are familiar with the Scottish word thrawn. It doesn't mean stubborn, it basically means Scots don't like being told what to do.”

A Better Together spokesperson said: "The paranoia of the nationalists is reaching ridiculous levels now. They should stop blaming everybody else for their failing campaign."