A man was jailed for two years for the assault and robbery of a 62-year-old man near Kirkcaldy railway station.
Mark Smith, 44, targeted his victim by a bus stop in Bennochy Road in the early hours of August 8 and told him he would stab him.
He punched the man on the head and demanded money before making off with around £26 and his mobile phone.
Smith, who was captured on CCTV footage, was identified by police and arrested.
At Kirkcaldy Sheriff Court the Perth prisoner admitted assault and robbery and was told by Sheriff Jamie Gilchrist QC his attack must have been “extremely frightening” for the victim.
Procurator fiscal depute Claire Bremner told the court the victim fell to the ground when Smith punched him and he handed over six £1 coins.
She said: “The accused then shouted ‘I know you have money, if you don’t give me your money I’m going to stab you’.”
The terrified victim handed over a £20 note and after Smith ran away he noticed his phone, which must have fallen from his pocket, was missing.
He went to the nearby police station for help, where an officer noticed he was bleeding from a wound on his head.
Solicitor Dewar Spence said Smith was a methadone addict who had been “dragged into” crack cocaine use and said: “This was motivated by seeking money to fund that habit.”
He said before the offence Smith had sought help but he added: “There is a limit to the assistance available and he found himself not being seen as an urgent case.”
Mr Spence said Smith could only apologise to the victim.