A shop owner fought off an armed robber who threatened her with a knife at her Burton store, a court has heard.
VijayaKumari Kirupaharan refused to open the till and struggled with the man before locking herself in a storeroom.
Watched by stunned customers would-be robber Zishran Ali had tried to force open the till but failed and fled empty handed.
At Stafford Crown Court 24-year-old Ali was jailed for a total of for almost four years. Ali, of Queen Street, Burton, had admitted charges of attempted robbery and possession of a kitchen knife.
The court heard the incident in July at Ash News Food & Wine in Uxbridge Road was captured on CCTV in the store.
Judge Paul Glenn, jailing him for 45 months, said the victim knew Ali and where he lived and there was clear CCTV evidence, but Ali had initially said he was not involved.
The judge said: "It is clear there would have been a robbery had this lady not stood up to you."
In an impact statement Mrs Kirupaharan said she had been terrified and upset because the raid was carried out by someone she knew.
She was said to have been left shocked and scared about being in the shop alone and also feared there could be repercussions.
Fiona Cortese, prosecuting, said Ali had been recalled to prison after his arrest because he committed the offence while on licence from a five-year sentence imposed in 2013 for robbery, possession of a weapon and attempted robbery.
Ali also had other previous convictions dating back to 2008 for robbery, thefts, blackmail and demanding money with menaces.
Miss Cortese said the incident at the shop happened around 5pm on July 10 when Ali waited until Mrs Kirupaharan opened the till while serving a customer.
She said: "She could see the knife which Ali was pointing at her upper body and she closed the till and tried to get into the storeroom."
Ali grabbed her arm and pulled her back and demanded that she opened the till but the shop owner refused and there was a struggle before she was able to shut the storeroom door.
Customers in the store backed away as Ali tried to open the till but he failed and fled empty handed.
He was arrested later the same night but told police he was not him in the shop.
Stephen Hennessy, for Ali, said his client had drifted back to old friends and taking drugs after losing his job and having to leave the family home.
"He was back sofa surfing and back 'in the gutter' where he had been before and was taking cannabis and other drugs and incurred a debt with a local dealer," he said.
Mr Hennessy said Ali was sorry for his actions which were the result of 'sheer desperation'.