A boy told garda interviewers he heard schoolgirl Ana Kriegel scream after she and his co-accused went into an abandoned house, a trial heard.
Boy B then started crying during the interview and said he ran away because he was scared and he thought Ana and Boy A had been attacked.
He thought Boy A would be able to protect her, he said.
The two youths, aged 13 at the time, have pleaded not guilty before the Central Criminal Court to the murder of Ana Kriegel (14) at Glenwood House, Laraghcon, Clonee Road, Lucan, on May 14 last year.
Boy A has also denied a charge of aggravated sexual assault.
On Wednesday, the jurors continued to watch video footage of interviews gardai conducted with Boy B at Finglas Garda Station last May 25.
Present during the fourth and fifth interviews were Boy B, his mother, his solicitor Barry Powderly, Det Gda Donal Daly and Det Sgt (now Inspector) Damien Gannon.
At the start of the fourth interview, Boy B said he wanted to clarify something.
He told gardai he was going to re-tell the story as "what I told you yesterday was a lie".
He said he did not meet Boy A in the spot in the park where he previously said he had met him.
Boy B said he and Ana walked over towards the BMX track and he met Boy A near it.
Boy B said he let Ana talk to Boy A for a while, but he stayed back to give them some privacy to talk. He then got bored and left.
"That's the truth," he said.
Boy B told gardai he was "scared and nervous" when he first spoke to officers investigating Ana's disappearance, and he could not really remember where he met Boy A, so "I made it up".
Once he did remember, Boy B said he could not go back as he had already given a statement so he "kept to the story".
Asked why the boys had arranged to meet at the BMX track, Boy B said he did not know.
The court heard the BMX track was close to the abandoned house where Ana's body was found.
Asked if he had been in the abandoned house that day [May 14], Boy B said "on the day I wasn't but I was before, yeah".
During interview four, Boy B was shown some photos, including one of Boy A's boots.
Gardai told Boy B there was blood spatter on the boots and it matched Ana's DNA.
"No, no, [Boy A] wouldn't do that," he said.
Gardai said blood spatter on Boy A's boots meant he either assaulted Ana or was standing by when it happened.
Boy B said Boy A was one of his closest friends.
"I don't want to believe it was [Boy A]," he said.
Boy B was shown other photos, including one of a rock found at the crime scene, which gardai said had Ana's blood and hair on it.
Boy B responded: "Jesus Christ, it gets worse and worse."
He also told gardai: "I don't know what happened. I wasn't in the house."
During interview five, gardai said a witness had seen a boy going into a field near the abandoned house and they believed this was him.
"OK, I did go into the field, but it was to look around," he said, adding that he did not go any further.
Gda Daly put it to Boy B that he was presenting him with facts and evidence and Boy B was changing his story to suit.
Gda Daly told Boy B a girl had been brutally murdered and Boy B owed it to himself, his mother and Ana to tell the truth.
Boy B then said that he, Boy A and Ana had walked through the fields and Boy A took Ana into the house.
He was just "tagging along" and did not go into the house. He then started to leave.
"It was then I heard a scream," Boy B said, adding: "I was walking away when I heard the screaming."
He described it as a "really like strong scream" and he could hear it from outside the house. He knew it was Ana, he said.
Boy B told gardai that "just when it was about to end it got muffled".
Boy B started crying in the interview. When asked why he ran away, he said he was scared, and he thought Ana and Boy A had been attacked
Boy B said he ran home and kept thinking that everything would be all right and Boy A would protect Ana.
The trial continues.