Two would-be teenage robbers fled after a filling station worker in Sandholes lifted a hammer and told them to “wise up”, the High Court heard on Wednesday.
Prosecutors said their target’s response was in demands to hand over money at knifepoint just outside Cookstown, Co Tyrone.
Details emerged as 18-year-old David Cunningham was granted bail on a charge of attempting to rob the garage on February 11.
Cunningham, of Riverside Drive in the town, was arrested with a 15-year-old co-accused following the alleged raid.
Prosecution counsel said two intruders with scarves covering their faces tried to hold up the premises in the Tullylagan Road area.
Cunningham is alleged to have pointed a knife with a 12-inch serrated blade at the shop worker and repeatedly demanded: “Empty your till.”
The younger suspect stood beside him throughout the incident, the court heard.
“When the demands for money were made the victim responded by saying ‘wise up’ and moved from behind the till,” the prosecutor said.
“The victim located a hammer from a shelf and showed this to both suspects who ran from the shop.”
Mr Justice Stephens heard the man followed the pair and watched as they discarded clothing in church grounds before stopping them heading into Cookstown.
It was claimed that he recognised Cunningham’s voice from the shop.
Police called to the scene located clothes and a knife in the area.
Granting bail, the judge ordered Cunningham to abide by a curfew and electronic monitoring.
He also warned the accused could be returned to custody if he does not record efforts to gain employment.