A man's head was stamped on until he lost consciousness during a suspected hate crime attack in Londonderry, the High Court was told on Tuesday.
Prosecutors said police are investigating claims that he was called a "foreigner" in an assault that led to him being placed in a medically-induced coma.
Details emerged as bail was granted to one of the three alleged assailants.
John Sweeney (39), of Baltimore House in Derry, faces a charge of causing grievous bodily harm with intent over the incident on May 3 this year.
The court was told a passing motorist said he witnessed two co-accused punching the victim until he collapsed into a doorway on Carlisle Road.
One of those two then allegedly inflicted further blows.
Crown lawyer Lauren Cheshire said: "The witness counted about six to seven stamps, and it appeared the victim was unconscious because at no time did he attempt to fight back or defend himself."
The motorist beeped his car horn in an attempt to stop the attack, according to the prosecution, but was told to "f*** off".
Based on the victim's account, John Sweeney is only alleged to have thrown the first punch after a co-accused demanded money.
The man, understood to be a Polish national, claimed he fell forward before another assailant "unloaded" a series of blows.
"He said he remembers maybe one stamp to the head, but probably lost consciousness after that," Ms Cheshire submitted.
He had to be put in a coma when his condition deteriorated.
The man was then transferred to the Royal Victoria Hospital in Belfast, where he remained in the coma for four days.
"When he regained consciousness he was left with 21 staples to his head and a bleed on the brain," the prosecutor said.
Mr Justice Horner was told the victim also alleged remarks were made about him being a "foreigner".
"Police are investigating a hate crime element to this," Ms Cheshire disclosed.
Although Sweeney is not accused of inflicting any of the subsequent blows, she claimed he made no attempts to stop the others and was charged as part of a joint enterprise.
Defence counsel Kelly Doherty challenged the strength of the case against her client. She argued that statements from witnesses suggest the complainant had been drinking with other males in the area.
The judge banned any contact with his co-accused and ordered the lodgment of a £5,000 cash surety before his release.