As he ran backwards trying to flee two gangs violently clashing by the beach, Hashim Mohamed tripped and fell to the ground.
The rest of his group ran and left the 18-year-old lying there, unarmed and defenceless, as knives were plunged into him by several boys.
Mr Mohamed tried to resist, sliding backwards and kicking out with his feet, when he was stabbed through his back.
His attackers ran away and then returned to hurl abuse and spit at him as he was unconscious and bleeding to death at Melbourne's St Kilda beach on December 4, 2022.
The knife was still protruding from the teen's body as he was taken to hospital, where he later died.
The youngest of the group, 15, pleaded guilty to manslaughter in the Supreme Court after his DNA was found on a knife sheath he discarded next to a bin, while others in his gang faced affray offences.
The boy wrote rap lyrics in the days after the attack, found on his phone along with photos of a police van captioned "come catch me".
Justice Jane Dixon said writing rap lyrics was "callous and repugnant" as she sentenced him on Tuesday.
"They are indicative of your immature and remorseless attitude at the time of writing," she told the boy.
She said Mr Mohamed's "tragic death" also had wider ramifications for the community.
"No civil society should endure the loss of a young man's life during an episode of mindless gang violence in a public place on an otherwise peaceful Sunday afternoon," Justice Dixon said.
However, the judge found the boy, now aged 17, had exceptional circumstances that justified him receiving a youth detention sentence as opposed to an adult prison term.
She said his potential for reform was at "a critical juncture" and would be disrupted if he was placed in an adult jail.
"This would not be in your interests or the community's interests, despite your serious offending," Justice Dixon said.
"It appears to me that there will be very little to be to gained, and in all probability, a great deal to lose by imprisoning you within an adult jail."
The boy, who was convicted of other violent offending in a children's court after the St Kilda stabbing, was handed a four-year term in a youth detention centre.
His DNA will be retained in a database for the rest of his life.