A Dundee man who hurled a sword at three Muslim men after they escaped from a fire has been jailed for almost two years.
Dundee Sheriff Court heard Grant Robertson also shouted racist abuse at the men as they waited for the fire service outside their flat on 26 January.
Robertson pleaded guilty to a charge of acting in a racially aggravated manner.
The 28-year-old also admitted a second charge of assaulting the three men.
The court heard that when he was arrested Robertson told police: "I threw my sword out the window at them, I wish it got them in the throat."
Dundee Sheriff Court was told that Mahmut Turk had been praying in his flat in the city's Craigmount Road at about 00:10 on the night of the incident when he smelled smoke.
He woke his roommate Yusuf Akhaya, who called the emergency services, and then rushed from the flat, where they met their other roommate, Emre Sezen.
But as they waited for the fire brigade, Robertson climbed out of his first floor window and began his tirade.
Fiscal depute Trina Sinclair told the court: "Police attended with the fire brigade and went in to make inquiries.
"The accused then came to the window of the property and started shouting at the three men, saying things like 'I will kill you all' and 'Muslim bastards'."
She told the court Robertson then disappeared from the window and came back brandishing the weapon.
Ms Sinclair said officers could see the accused hanging out the window shouting and swearing.
She added: "Police attended his property and spoke to him through the door, but he continued shouting and swearing and making racial remarks."
The fiscal depute said Robertson was taken to police HQ and charged with attempted murder.
She told the court: "In reply he said 'I never attempted to murder, If I was going to murder him I would do'."
Police had originally charged Robertson, who has previous convictions for assault, breach of the peace and vandalism, with attempted murder.
Robertson also admitted a charge of vandalism after he smashed up a car using a traffic cone, causing £250 worth of damage, on 5 October this year.
He also admitted breaching a community payback order.
Jailing Robertson for a total of 23 months, Sheriff Elizabeth Munro said: "The indictment matter is particularly serious - and on top of that you have not made any effort at all towards this community payback order and to make things worse while you were on bail you go and behave in this way and attempt to destroy somebody else's property.
"Only a custodial sentence is appropriate in these circumstances."