An armed robber has admitted pulling a gun on a shop assistant before cocking the weapon during a raid on an Edinburgh supermarket.
David Taylor walked into a branch of Scotmid and asked for two pouches of tobacco and a carrier bag before demanding money at gunpoint.
Father-of-five Taylor, 43, fled from the premises with the bag containing cash and the tobacco.
The robbery happened on 15 April this year.
Lord Pentland deferred sentence on Taylor until next month for the preparation of a background report and remanded him in custody.
Footage of the assault and robbery was shown to the court and the judge, Lord Pentland, said: "That must have been an extremely alarming episode for the complainer."
The shop assistant, Aaron Blyth, 23, felt scared for his safety during the offence and was left dazed and distressed afterwards, the court heard.
Taylor was wearing a cap and had his hood up when he approached Mr Blyth at a checkout and asked for the tobacco and a bag.
Mr Blyth put the items on the counter and looked away for a moment. When he looked back at Taylor he was holding a handgun in front of him just above the counter.
The prosecutor said: "Mr Blyth saw a chamber as it was being cocked but could not see if there was any ammunition in it."
Taylor told him in a quiet voice to "get the money out of the till".
Mr Blyth pressed the panic button and he and a colleague closed the store while they waited on police to arrive.
Taylor was arrested five days later at his home in Edinburgh and told officers that he had recently lost his job and said: "I'm not short of money but it's getting that way, you know." During an interview he denied he was responsible for the robbery.
The court heard that Mr Blyth was unable to say precisely how much money was taken but thought there was about £120.
The court heard that Taylor, a prisoner in Edinburgh, was previously sentenced to six years' detention in 1995 following a conviction for assault and attempted robbery at the High Court.