Mark Armstrong, 40, stalked the terrified woman at various addresses in Edinburgh between October 2011 and December 2011.
The stalker was never romantically involved with the woman - but pursued her all over the city. He approached her in Maderia Street, St Andrews Square and Leith Walk.
He turned up at her workplace and made telephone calls in which he threatened violence.
She was terrified about what would happen to her - but managed to pluck up enough courage to contact Lothian and Borders Police.
Concerned officers then swooped on Armstrong and managed to take him into custody.
Armstrong is one of the first people in Scotland to be convicted under tough new anti-stalking laws. His conviction was welcomed by leading prosecution lawyer, the Solicitor General Lesley Thompson QC.
Armstrong, a prisoner of HMP Edinburgh, was also jailed for two years and six months by Sheriff Neil Mackinnon.
Sheriff Mackinnon also ordered Armstrong be placed under supervision by the authorities for 12 months following his release back into the community.
And he also made an order stopping him from approaching his victim in the street for the next two decades.
Passing sentence Sheriff Mackinnon said: “The requirements for public safety demand me to impose a custodial sentence on you.”
His victim sat in court with friends and wept as the Sheriff delivered his verdict. Armstrong, originally of Leith, was convicted at an earlier hearing at Edinburgh Sheriff Court.
He spent his youth in Canada and has previous convictions from his time there.
During earlier proceedings, the court heard how Armstrong started approaching his victim in the street and even turned up at her place of work.
Armstrong then started following her - he was seen walking behind her in Maderia Street, St Andrews Square and Leith Walk in Edinburgh.
Armstrong also discovered her telephone number and started repeatedly ringing her.
Today defence solicitor advocate Jim Stephenson said his client had been abusing steroids during the time of the stalking.
Saying Armstrong wanted to apologise to his victim, Mr Stephenson added: “He accepts he was abusing steroids at the time of the offences. He obtained these steroids from the Internet and he was injecting them once a week.
“He accepts that this made him more aggressive.”
Speaking after the case, the woman thanked prosecutors for the help they gave her.
She added: “I am relieved that the legal case is now concluded and pleased with the outcome and that justice has finally been done.
“The support available to me as a victim of this crime was amazing. From when the accused appeared in court and all throughout the process, I knew the Victim Information and Advice Officer was there for me to explain the process, what was happening with the case and about support available to me.
“The legal process was something new to me but I was able to come in and have face to face meetings and pick up the phone anytime and know that support was there for me.
“Although coming to court was a daunting experience again support was available to me.”
Solicitor General Lesley Thompson QC said: “Stalking can have a devastating and lasting impact on the lives of victims.
“Scotland’s prosecutors are dedicated to bringing to justice all those who, like Mark Armstrong, pursue a campaign of stalking and harassment
“Though many of his actions, if taken in isolation, could perhaps appear innocuous, it was his persistent course of conduct that caused fear and alarm and constituted the statutory offence of stalking.
“We would encourage anybody who is the subject of this type of behaviour to have no hesitation in reporting what is happening to the police and prosecutors take such offences extremely seriously.”