An armed raider disguised himself with a crash helmet before carrying out a £6,000 knifepoint robbery at a betting shop then fleeing on a mountain bike.
But 26-year-old Marco Conti was captured on CCTV casing the Ladbrokes branch three times before he struck.
And a sharp-eyed policeman recognised the first offender in images captured by the security cameras.
Inverness Sheriff Court heard that when DNA found on the knife, the bike and the helmet matched Conti’s, he was charged.
He is now facing being jailed after being remanded in custody until he appears in court again for sentence next month.
Conti, whose address was given in court papers as c/o 28 Preston Terrace, Prestonpans, East Lothian, was living in the Highland capital when he carried out the robbery.
He admitted assaulting Ladbrokes manager Robert MacPherson in his Balloan Park bookmakers premises on September 29 last year, and robbing him of £6,320 while armed with a knife and with his face masked.
Fiscal depute Roderick Urquhart told the court that Conti was filmed on the betting shop’s CCTV cameras arriving at the premises on his mountain bike three times.
Mr Urquhart said: “The first time was at 1.13pm when he looked around, picked up a betting slip but did not place a bet and then left on a black and white mountain bike.
“He returned at 4.50pm on the bike, placed a bet and then left. He returned a third time at 6.50pm and was seen paying attention to the back of the shop. He remained for 30 seconds and then left.
“About 9pm when there were no customers, the manager was counting the takings. There was £6,000 in mixed notes in a bag in the safe and £320 in the till.
“About 9.20pm, Conti came in wearing a cycle helmet and a scarf over his face and had a brief discussion with the manager about a football match. He then produced a knife at the manager and said ‘give me the money’.
“The manager gave him the £320 from the till but Conti then demanded the money from the safe before leaving and warning the manager not to activate the alarm.
“The bike, helmet and knife were found a short distance away, the images were circulated amongst the police and one officer recognised him.”
Mr Urquhart added: “There was a one in a billion chance that DNA samples recovered from the handlebar grips, the knife and the helmet were not from Conti.
“A warrant was then obtained to check his bank account, and this showed he made two deposits of £1,000 and £550.”
Conti’s agent, solicitor Pauline Chapman, asked that he be allowed to remain on bail until a background report had been obtained.
But Sheriff Margaret Neilson said: “Because of the seriousness of the offence, bail will be revoked and he will be remanded in custody.”
Conti will be sentenced on July 7.
During the hunt for the Ladbrokes robber, police released images of distinctive high-top trainers similar to those worn by Conti.
Earlier, officers recovered the knife, crash helmet and getaway bike in gardens in the residential Hilton area.
Ladbrokes declined to comment yesterday.