A delusional soldier was convinced the Taliban had taken over his local tandoori take-away and headed there with a machete.
On his way to the hot food shop, Scott Mackay phoned 999 and issued a warning that he was going to kill Muslims.
Police arrived at the scene to detain Mackay, 32, and when his Rosyth home was searched it contained army explosives.
Mackay, who had been suffering mental issues associated with serving in the world’s trouble-spots, avoided a prison term when he appeared for sentencing at Dunfermline Sheriff Court.
He had been held as a prisoner at Perth since being found guilty following trial in April. Sentence was delayed by obtaining reports and assessments.
The trial largely consisted of specialists giving evidence about Mackay’s state of mind at the time of the incident.
His mental health issues were not helped by heavy consumption of alcohol and he now faces a three-year booze ban.
He has also been placed on a restriction of liberty order for a year, which is expected to end his army career.
Mackay had become convinced that the Taliban was operating out of the Sizzlers tandoori take-away in Rosyth’s Queensferry Road.
His defence solicitor Brian Black had told the trial his client had “negative attitudes toward Muslims”. He said: “His views had arisen as a result of his experiences and operations.”
On the night of the offence, Mr Black said, Mackay was acting “a bit odd” when police arrived.
He said: “He was not falling about. He had put the machete down and called 999.”
Mackay was found guilty of acting in a racially aggravated manner on September 20, last year, by phoning a call handler with Police Scotland, repeatedly swearing, stating that he was armed with a machete and uttering threats of violence and death to Muslims.
He was also found guilty of being in possession of a machete in Queensferry Road, Rosyth.
He had admitted a third charge that on September 21 at his home in Hudson Street, he kept explosives, namely flares and pyrotechnics.
Mr Black told the court his client was looking forward to going back to his family.
Representing the army, Captain Scott Shaw said a restriction of liberty order would probably mean Mackay could not continue to serve in the army.
Sheriff Charles Macnair told Mackay, “This was a serious offence in the street in Rosyth.
“It saw you go out with a machete and you were threatening to kill perfectly innocent members of the public who, partly because of your delusion, you thought were posing a danger, but they were not.
“Furthermore, you had in your house explosives which you had removed from the army.
“I’m acutely conscious that this order will involve your discharge from the armed forces.”
Sheriff Macnair imposed a community payback order with three years’ social work supervision, three years’ supervision under the forensic mental health team and Mackay was ordered not to consume alcohol for three years.
Mackay was also made subject of a restriction of liberty order for 12 months.