A police officer who created an elaborate fiction to make a woman think she was being monitored and was at risk of harm has been jailed for more than two and a half years.

Scott Gorrie's actions, which preyed on the woman's fears about her estranged husband, caused his victim significant fear and alarm and led her to be signed off work with stress.

The 43-year-old previously admitted a charge of stalking , two charges of attempting to pervert the course of justice and one of breaching the terms of his bail, prosecutors said.

He was jailed for two years and eight months and handed a three-year non-harassment order at Perth Sheriff Court on Thursday, the Crown Office confirmed after the hearing.

According to prosecutors, Gorrie was called to the woman's home over a domestic complaint in May last year.

Soon after, he made contact with her online and she told him of her fears that her estranged husband was monitoring her movements in some way.

From mid-June, Gorrie - who made out that he was a single father of two - began creating a fiction based on the fears she held.

According to the Crown Office, Gorrie started to send messages which led her to believe that they were both being followed.

The content and tone of the messages reinforced her belief that her ex-husband was monitoring her and "had it in" for her.

Gorrie also made the woman believe that he was in personal danger and his messages became increasingly alarming and frightening.

His fiction began to unravel when the victim contacted police about her ex-husband's conduct, prosecutors said, and he took steps to try to cover up what he had done.

Les Brown, head of the criminal allegations against the police division, said: "Stalking can have a devastating and lasting impact on the lives of victims.

"Scott Gorrie knowingly placed a vulnerable woman in a state of fear and alarm through his criminal behaviour.

"This was a full and thorough investigation by prosecutors and Police Scotland's anti-corruption unit (ACU), and I am grateful to all involved for their assistance in securing today's outcome."