An armed robber ran from the store he was raiding after the shopkeeper squirted him in the face with fly spray.
Wayne Barnes, who was carrying a BB gun that the victim described as a "James Bond-type gun" and wearing a balaclava, stormed into the Booze Bar at Carhill Road in Gateshead on September 8 and demanded cash.
Newcastle Crown Court heard the lone worker, who had been using insecticide to clear flies from his shop, told the 33-year-old former soldier to "f*** off" - then squirted him with the repellent.
Barnes then left he shop empty handed but the victim said: "I thought he was going to shoot me. It thought he was going to do it while I was all alone in the shop. I was scared."
The shocking raid, which happened at the shop's closing time, was captured on the store's CCTV and the footage was played in court.
Barnes, of Cairo Street, Sunderland, who was on suspended sentence and two conditional discharges at the time, admitted attempted robbery and having an imitation firearm with intent to cause fear of violence and has been jailed for 45 months.
Judge Sarah Mallett told Barnes: "You went into the shop wearing a balaclava and carrying a black handgun he described as a James Bond gun.
"You demanded money from the till, pointed the gun at him with your arm outstretched.
"He said he wouldn't give you any money and persisted in demanding money.
"He refused in stronger terms.
"He had a can of spray in his hand at the time, which he squirted in your face and you left and ran away."
Prosecutor Emma Dowling told the court the weapon Barnes was carrying was a .177 calibre, gas powered BB gun and had his face covered when he went into the shop demanding money.
Miss Dowling said: "The complainant had a can of insecticide in his hand because he had been spraying flies.
"He used that to squirt the defendant in the face and the defendant left the shop."
The BB gun was seized when Barnes was arrested after being traced back to his home.
Barnes told police he had been "forced" to carry out the raid because of a drugs debt.
Jennifer Coxon, defending told the court Barnes, who had been due to start work at Nissan just days after the raid, had struggled with civilian life when after his five-year army career ended and had turned to drugs to help cope.
As a result he ran up a drugs debt but has now been clean of his cocaine habit for a year-and-a-half.
Miss Coxon added: "The drugs debt came back to haunt him prior to this offence.
"He made a very silly decision."
Barnes, who has previous convictions but none for such serious offending, appeared at the hearing via video link to HMP Durham, where he had been held on remand.
He said: "I actually got frightened when I had done it, when I realised what I was actually doing.
"I would like to say to him I am deeply sorry for what I did."
The judge said she accepted Barnes was an "intelligent and employable" man who was genuinely sorry for what he did.