An armed robber held up a Perth supermarket worker at knifepoint, before helping himself to cash from the till.
Only weeks later, David Edevane targeted the BP filling station in Dunkeld Road, just yards from the city police headquarters.
However, as the masked 36-year-old fled to the exit, a quick-thinking shop assistant locked him inside, hampering his escape.
Edevane appeared at Perth Sheriff Court to admit both offences.
Sheriff George Way told him: “You have taken a big step change in criminal conduct.
“I’m in two minds about giving you your liberty.”
Deferring sentence until next month, the sheriff told him: “The court’s primary position will be that this merits a custodial sentence.”
Checkout robbery
Fiscal depute Gavin Letford said Edevane went to Aldi dressed in black, with a white surgical facemask and “distinctive” white trainers that appeared to be untied.
He was carrying a sports bag.
At about 8.40pm, supermarket worker Matthew Findlay took his seat at the checkout.
“Shortly afterwards, Mr Findlay became aware of the accused approaching the till.
“The accused placed a basket containing a bottle of lemonade on the conveyer belt and thereafter moved to the end of the till.”
The fiscal depute said: “The accused moved his left arm and Mr Findlay saw that he was holding a knife with a silver blade of about two inches.
“The accused stared at Mr Findlay and demanded he opened the till.
“Mr Findlay advised that he could not open the till.
“The accused bent towards him and told him: ‘Open it f***ing now.’
“Mr Findlay pressed the cash button and opened the till.
“He stepped back and the accused reached into the till with his left hand and removed a quantity of money.”
Edevane fled with about £170 cash.
Police officers arrived that evening and saw Edevane on CCTV.
They visited his home in St Catherine Road and spotted the white trainers, his black top and the white mask they had viewed on the security footage.
The flat was searched and officers recovered a lock knife and the stolen cash.
Trapped in filling station
The court heard that five weeks later, Edevane struck at the filling station.
“It was about 3am and employee Niboshan Suntharalingham was on duty alone at the filling station,” Mr Letford said.
“At this time, there was a delivery at the rear of the store.
“Mr Suntharalingham was aware of two males in the store. One of them was accused.”
When the other left, Edevane approached the counter.
“He placed at the till a white carrier bag with items he had collected in the store.
“The employee began scanning the items and the accused moved alongside him.
“He was wearing a black snood and mask, covering his neck, hair and forehead, and showing only his eyes.
“He was wearing dark clothing.”
Edevane told the shop worker: “Give me the money”.
Mr Letford said: “Fearing for his own safety, the witness opened the till.
“The accused began taking money out and putting it in the carrier bag.
“He also took a packet of tobacco before running towards the exit.
“Before the accused left the premises, Mr Suntharalingham managed to lock the doors and trapped the accused within.
“He then locked himself in the store room, where he watched the accused force open the doors and run off.”
‘That’s me f***ed’
Edevane was traced by police about 300 yards from the filling station.
When he was arrested, Edevane told officers: “That’s me f***ed.”
Police found his knife near the filling station and a bag with just under £400 in a courtyard near Edevane’s flat.
Solicitor David Holmes said his client “expresses his regret for what he has done”.
Edevane admitted assault and robbery at Aldi on February 4, last year and at the BP filling station in the early hours of May 11.
He was released on bail and will be sentenced on April 13.