Nathan Ritchie had been working for a practice in Dundee - but was let go last summer without a severance package.
Six weeks later he walked into an alleway beside a William Hill bookmakers in the upmarket Broughty Ferry area of Dundee and changed into a full black outfit, including a stocking for his face, that he had brought along for the job.
Ritchie then entered the store and leapt over the counter before pulling a knife on shop worker Alison Edwards and demanding she empty the safe.
He then made off with £716 before police were called to the shop and a major investigation launched.
But officers didn’t need to look far - because Ritchie, racked with guilt, handed himself in that night stating: “It isn’t fair on the staff.”
Ritchie, a father-of-two, now faces a lengthy jail term when he returns for sentence at Dundee Sheriff Court next month.
Fiscal depute Stewart Duncan told the court that Ritchie had meticulously prepared for the robbery - packing a canvas bag full of dark clothes to change into before the attack, which took place around 11.15am on July 23 last year.
He said: “The complainer saw the accused entering on a CCTV monitor and as she got to the counter she saw him place his hands on the counter and jump up and over in to the till area.
“He then pulled out a large knife with a black handle and pointed it at her.
“She pushed the alarm button but he pushed it to turn it off.
“He demanded money while walking towards her pointing the knife at her chest.
“He said ‘give us the money - open the safe’.
“They walked into the back room and the complainer took out two rolls of cash.
“He shook his bag and she placed the money in.
“He demanded more money and she explained that was all the cash in the afe.
“He then said ‘the tills’ and went out to open the drawers.
“He opened one and took £216 them jumped over the counter and ran out.”
Miss Edwards then called 999 and police attended.
But around 10.30pm that night Ritchie cut short the police probe when he turned up at Broughty Ferry police office to confess.
Mr Duncan said: “He said he wanted to hand himself in for a robbery earlier that day.
“He freely stated ‘it’s not fair on the staff’ and said he was feeling guilty.
“He said he had lost his job as an architect six weeks prior to this.
“He said he had covered up and threatened the staff with a knife and took a bundle of notes.
“He said in advance he had put black clothing, stockings and a tammy in a black canvas bag.
“He had then attended the common close beside the shop, got changed in to the black outfit and went in with the knife concealed up his sleeve.
“He then changed back into his previous outfit before leaving.
“He said he was remorseful and needed to tell police what he had done.”
Ritchie, 38, of Dundee, pleaded guilty on indictment to a charge of robbery committed on July 23 last year in Brook Street, Broughty Ferry, Dundee.
Defence solicitor Anika Jethwa said: “He does appreciate the series position he is in today.
“He separated from his partner and his children as a consequence of this.
“He is aware of the sentence that the court will have in mind for this matter.”
Sheriff Tom Hughes deferred sentence until next month for social work background reports and remanded Ritchie in custody meantime.
He said: “I have had a detailed narration of what happened and it is abundantly clear this is a very, very serious matter and and obviously the court will have to take it seriously.
“It is appropriate that you be remanded in custody pending preparation of these reports.”