A 20-year-old man has gone on trial accused of murdering a Japanese man and assaulting two other men in Dundalk, Co Louth in January 2018.
Mohamed Morei, an Egyptian national with no fixed address in Ireland, has pleaded not guilty by reason of insanity to all charges.
Yosuke Sasaki was described by the prosecutor Sean Gillane as a "hard-working and intelligent" young man.
The 24-year-ol had just finished work at a factory in Dundalk and was on his way to pick up a package from the post office when he was attacked from behind.
Mr Gillane told the jury they would be satisfied that the accused, Mohamed Morei, stabbed him once in the back before going on to attack two others.
Just before the attacks, he said members of the public reported a man acting irrationally on the streets of Dundalk.
The court heard Mr Morei initially resisted arrest.
Gardaí described him as "agitated" and of having "disorderly thoughts" during interview.
A doctor who examined him recommended he be taken to the Central Mental Hospital - where he has remained in custody since his arrest.
Mr Gillane said there would not be any real dispute in relation to the facts of the case; but he said two consultant psychiatrists would give evidence in relation to an alleged mental disorder he was suffering from at the time.
The jurors will eventually have to decide if the special verdict of not guilty by reason of insanity applies.
Reporting by Frank Greaney