A man who put a gun to a woman's head and threatened to shoot her, just weeks after meeting her on an online dating site, has been jailed for more than four years.

Kenneth Ellis left his 40-year-old victim fearing that she was going to die.

She managed to make a 999 call reporting that Ellis had a gun and when police arrived they found her standing in the middle of the road shaking uncontrollably.

Ellis, 44, also subjected another woman to harassment by turning up at her home and repeatedly sending her text messages and phoning her.

At the High Court in Edinburgh, Lord Turnbull told him: "You have pled guilty to two offences involving behaviour of a controlling and demanding nature towards two separate women.

"It seems to me appropriate that a custodial sentence is imposed in respect of the present matters."

He jailed Ellis for three years and nine months for the incident involving the gun and a further four months and 15 days for the offence against the other woman.

Ellis had earlier admitted abducting and assaulting a woman at his home in Telford Drive, Craigleith, Edinburgh, on August 6 and 7 last year by seizing hold of her, repeatedly threatening to shoot her, pressing a gun against her head, placing her in a state of fear that she was about to die and locking her in the house.

He also admitted engaging in a course of conduct between March 2014 and August last year at addresses in Edinburgh which caused a 28-year-old woman fear or alarm by repeatedly texting, phoning and attending at her home uninvited.

Advocate depute Angela Gray said that Ellis and the 40-year-old woman had contacted each other through a dating website about three weeks prior to the gun incident.

Within a fortnight they met up and began a relationship.

During the evening of August 6 she had been visiting Ellis who became upset.

Ellis claimed that he had "got people to dig their own grave and then shot them".

The woman started to feel concerned and went through to a bedroom. Ellis was pacing about the flat and according to the victim "smashing the place up".

The court heard the victim felt terrified and started to pack her bags and told him that she just wanted to go home until things calmed down.

Ellis grabbed her by the arms and told her: "You're going f****g nowhere because I'll shoot you first. You're no leaving me. If I let you out that door you'll no come back."

The woman managed to get to the front door but found it locked. She got the keys and tried to open the door but was shaking and could not unlock it.

The prosecutor said: "The accused shouted, 'Where do you think you are going. I am going to f*g shoot you'.

"When the victim turned around she saw the accused was holding a gun, which he was pointing directly at her. The victim describes it as a small handgun. The accused pressed the gun against the victim's forehead and at that moment she thought she was going to die."

The victim took her chance to call 999 when Ellis went into a bedroom to phone a friend.

She then managed to flee the house.

Police recovered a gun that was capable of firing plastic ball bearings from the flat.

Ms Gray said that since the incident the woman has since suffered nightmares and flashbacks.

Defence solicitor advocate Leanne McQuillan said: "He fully appreciates a custodial sentence is inevitable."

Download: The STV News app is Scotland's favourite and is available for iPhone from the App store and for Android from Google Play. Download it today and continue to enjoy STV News wherever you are.