Concert pianist Graeme McNaught, 55, had twice walked free from court on charges of stalking Miss Galloway despite subjecting her to years of harassment.
The writer resorted to launching a civil action against McNaught and has now celebrated seeing him hit with a lengthy ban on approaching her.
Miss Galloway, 60, of Uddingston, Lanarkshire, said: “I am pleased, and hugely relieved, there has been some redress following the ordeal of two separate court cases which returned verdicts of culpability for harassment over what is now a 17-year period.
“A grant of order for 10 years is unusual, I believe, and allows time for Mr McNaught to put in place some useful measures against it happening again.”
A hearing at Hamilton Sheriff Court had seen lawyers for Miss Galloway ask for the banning order following a string of criminal hearings in the past year.
McNaught, of Mount Vernon, Glasgow, had twice walked free from trials after concerns had been raised over his mental health.
In May a jury took less than an hour to acquit him on the grounds of insanity. McNaught was held in a psychiatric unit but allowed to return home after a sheriff heard he had responded well to treatment.
And last year an examination of facts heard a sheriff rule McNaught had carried out a campaign of stalking against Miss Galloway but his health prevented action being taken against him.
McNaught, who was not at the most recent hearing, had not opposed the non-harrassment order which was granted by Sheriff George Jamieson.
He will now face criminal proceedings and possible jail time if he breaks the order.
Miss Galloway has called for changes to the law on stalking and said she hoped her victory would help other victims.
She added: “This redress, however, was found via civil court only. Had I not been eligible for Legal Aid to pursue things in this way, it would have been unaffordable.
“This makes me worry for most others in what was my position. I am further well aware that criminal court would again be where things were referred following any rearrest, which may only lead to another poor fit with existing criminal law.
“I hope this does not happen. Better still, perhaps some change following cases of stalking which recognises the victim as central may be found.
“More people than me are affected by the failures I have met. It would be good to feel the criminal cases had at least some possibility of lasting use for the future.”
Miss Galloway had earlier told how she felt ‘suicidal’ as McNaught repeatedly tried to contact her.
She also revealed she feared being a victim of ‘revenge porn’ after McNaught threatened to publish naked photographs of her pregnant.
The couple were in a relationship for around six years. They split in 1996 and the photos were taken when Miss Galloway was pregnant with their son James.
She said: “He was saying, ‘I have photos of you with no clothes on and I will show them’. He was saying that if I didn’t get in touch with him, it would be a way of saying, ‘Go ahead and do this’.
“He said he had been in contact with the Gallery of Modern Art who had offered him exhibition space. He was warning me that he could show me in a bad light in a public gallery.
“Have you heard of ‘revenge porn’ where ex-boyfriends post pictures of women who they have had relationships with on the internet? It felt like an early version of that.
“It was an utter dismissal, that my attachment to him over the years had any meaning at all, and it felt lousy. It was hellish.”