Ruhullah Aramesh, a 24- year-old linguist, was beaten to the ground and his head 'smashed by several deliberate blows' by six white youths who had shouted racist taunts, David Paget, for the prosecution, alleged.
Mr Aramesh never regained consciousness and died two days later from injuries which included brain damage.
An hour before the fatal beating, three of the gang had launched an unprovoked attack on an Asian family - one of them, Gampatt Maragh, 65, suffering a head wound requiring stitches after he was struck with a vodka bottle, the court was told.
In the dock are Paul Hannon, 18; Richard Turner, 19; Jamie Ware, 18; and three 17- year-olds who cannot be named because they are juveniles. They have all pleaded not guilty to murdering Mr Aramesh on 31 July last year. One of the juveniles has admitted manslaughter on the grounds of diminished responsibility.
All come from Thornton Heath where Mr Aramesh was killed. Mr Hannon and two of the juveniles have also denied a charge of violent disorder relating to the incident involving the Asian family.
Mr Maragh had been walking with two members of his family in Croydon, where they were 'followed or shadowed' by the youths who suddenly struck him on the head. The attackers fled when passers-by intervened. But Mr Paget added: 'By far the most serious incident happened about an hour later.'
By then the youths had all moved on to Thornton Heath, where Mr Aramesh had attended a family gathering and had then gone with friends to a petrol station to buy drinks.
Outside one of the girls in their group had been 'touched up' by one of the juveniles, Mr Paget said. One of the white youths apologised, saying his friend was drunk.
The group accepted the apology and went home - but were followed by the teenagers who were 'looking for trouble'. They banged on the front door and ordered them to 'come outside'.
'At least three of them were armed with iron bars or stones. They were enticing the Afghans away from their doorway, hoping they would follow,' Mr Paget said.
'There were taunts, 'Paki bastards', shouted at the Afghans,' he added, but there was no suggestion that 'any of those Afghans started the trouble which ensued'.
The white youths summoned help from friends spilling out of a nearby pub. Witnesses heard cries of 'there's a fight - some Pakis want their heads kicked in'. A running fight involving 20 youths followed.
The Afghans ran for the safety of their home, but Mr Aramesh slipped and was surrounded, kicked, beaten and battered.
The trial continues today.