A teenager was overheard boasting about attacking a 17-year-old student hours after carrying out the killing with two friends, Swansea Crown Court has heard.
Ben Bellamy was dragged out to sea before he died
Ben Bellamy, of Swansea, was found dead on a beach in the city last year after being attacked and dragged out to sea.
Andrew Rafferty, 18, of Mount Pleasant, Swansea, and friends aged 17 and 16, who cannot be named, all deny murder.
A witness told the jury how he heard the youngest one describe the attack. The trial continues.
Sixth-form student Ben was attacked after attending an 18th birthday party with friends at a nightclub in the Mumbles area of Swansea on 17 September, 2005.
Afterwards, he walked the five miles home to Sketty Park alone along the foreshore, before falling into the company of the three defendants.
Andrew Rafferty denies murder along with two friends
His body was found washed up on the beach the next day and was covered with the pattern of trainer tread after being kicked and stamped on numerous times.
The prosecution alleges the attack was motivated by the robbery of Ben's mobile phone and a cash card.
Robin Spencer QC, prosecuting, told the jury on Thursday that the youngest of the three, who was 15 at the time, visited a friend's house later that day.
The teenager was overheard by another youth who was working on his motorbike, describing how he had attacked Ben on the beach, the court heard.
'All punched him'
Mr Spencer said that in the overheard conversation, the 17-year-old accomplice "had wanted Ben Bellamy's mobile phone and Andrew Rafferty had wanted the cash card".
He added: "They had told Ben Bellamy that they were going to the Top Banana nightclub in Swansea centre and they asked Ben if he wanted to go with them.
"He agreed and they suggested that they all go down to the beach."
Mr Spencer said the teenager was overheard saying that the 17-year-old accused had "whacked Ben Bellamy in the face".
He said: "They had all punched him. Ben Bellamy had got up again and was knocked in the face again."
Mr Spencer told the jury the teenager was heard saying the three had taken Ben's cash card and his mobile phone before admitting that he kicked Ben Bellamy in the head and had told him to give them his pin number.
The jury was told that on realising he had been overheard, the youth allegedly became pale and reverted to a previous version of events saying Ben had got up and walked away after being punched.
Mr Spencer told the jury to bear in mind that the youth was still only 15 at the time of the overheard conversation.
He said he was not "as worldly-wise" as the other defendants and had perhaps revealed more as a result.
He also warned the jury that the alleged conversation took place when the other two defendants were not present to contradict him.
All three face alternative charges of grievous bodily harm with intent or inflicting grievous bodily harm.
Both Mr Rafferty and the 17-year-old have already admitted a charge of robbing Ben. The 16-year-old denies that charge. The trial continues.