A 15-year-old boy accused of murdering an elderly man in a park attack told a court he "panicked" after the incident and asked to swap shoes with someone when he spotted a police car nearby.
Bhim Kohli, 80, died on 2 September last year, a day after being assaulted just yards from his home in Franklin Park, Braunstone Town, Leicestershire.
Leicester Crown Court heard that Kohli suffered a spinal injury and fractured ribs during the attack.
Two children - a 15-year-old boy and a 13-year-old girl - are on trial in connection with Kohli's death. Neither can be named because of their ages. The boy denies murder and an alternative charge of manslaughter, while the girl denies manslaughter.
During cross-examination, the boy admitted to having anger issues but denied leaving Kohli for dead after racially abusing and beating him.
When asked by prosecutor Harpreet Sandhu KC why he wanted to swap shoes after the incident, the boy replied: "I'm not sure, I just panicked because of what happened - the incident at Franklin Park. I hit him with my slider, and pushing him."
The court was shown video clips of the attack filmed by the 13-year-old girl, which had been stored in her "My Eyes Only" folder on Snapchat. One clip shows the boy slapping Kohli in the face with a slider shoe while the elderly man was on his knees.
The teenage boy claimed he slapped Kohli "out of instinct" after they had a "tussle" over his slider that had "slipped off". He told the jury that in a later altercation, he "ran at" Kohli and pushed him over to defend the girl because he thought the elderly man was going to push or hit her.
Sandhu told the court the defendant had "difficulty keeping track" of his lies and had to "change his story" because he did not know that the girl had filmed parts of the alleged attack.
The jury heard that in messages to friends, the boy claimed Kohli had pulled out a knife and hit a girl, which he admitted in court was a lie.
When asked why he lied, the boy said: "I panicked and didn't want anyone to think bad of me."
Sandhu asked: "Why would they think bad of you? Because he died? He died because of what you did, do you agree?"
The boy replied: "Yes."
The prosecutor continued: "You also say that Bhim Kohli had done something bad. Did you make up that Kohli had done something bad in order to explain why you had done something bad?" The defendant replied: "Yes."
The court heard that in a letter to his intervention worker, the boy wrote: "I did it and I accept I'm doing time" and "I kinda just needed anger etc releasing." When asked what he accepted doing, the boy said "the incident with Kohli" but insisted he regretted "only pushing him" and denied punching or kicking the man.
Prosecutors allege the girl, who was 12 at the time of the incident, encouraged the boy's violence while filming and laughing during parts of the attack.
The trial continues at Leicester Crown Court.