A clinical psychologist, whose evidence the judge refused to allow go before the jury, said that Boy B was suffering from post-traumatic stress disorder after witnessing the assault on Ana and that his lies to gardai did not show that he was guilty of murder.
During legal argument in the absence of the jury it also emerged that Boy B gave the psychologist further details of what he saw happening to Ana, including seeing her top and pants being "ripped off", hearing gasping sounds, Ana struggling before "everything stopped" and Ana said nothing.
Boy B told the doctor he didn't know if Ana was dead when he saw Boy A stand up with his pants open at the crotch.
Dr Colm Humphries was called by Boy B's defence but Justice Paul McDermott refused to allow him to give evidence before the jury after the prosecution objected on the grounds that his evidence would make him a 13th juror, deciding the guilt or innocence of the accused.
Damien Colgan SC for Boy B said he wanted to call Dr Humphries to explain why Boy B reacted the way he did in garda interviews and how trauma can affect a child of his age and cognitive ability.
The prosecution alleged that Boy B lied in his garda interviews because he wanted to cover his guilt but Dr Humphries said his lies were not evidence of guilt.
Brendan Grehan SC for the prosecution said it is the jury's role to decide if an accused lied and why they lied.
He said: "The jury are to decide issues of fact and assess credibility of accounts and whether to accept or reject evidence and what they make of lies and what the possible explanation for lies might be."
Giving evidence during legal argument in the absence of the jury Dr Humphries said his first impression on meeting Boy B was that he was "overly friendly, very polite, a bit unboundaried but a pleasant, nice lad."
He was also quite defensive and Dr Humphries got the feeling there were things Boy B was not telling him.
He asked one of his colleagues to examine the boy and she found that he had poor self-monitoring, confusion with words and an inability to listen. Dr Humphries said the boy has "language difficulties" and is immature for his age.
When recalling events around what happened to Ana he would show signs of "disfluency" and avoidance. He would be unclear, went from ease to discomfort and seemed to "disconnect as if elsewhere."
He said this was a symptom of post-traumatic stress disorder. While he found there was evidence of "language difficulty" he said this was probably not picked up earlier because he's a "pleasant, lad and is bright, engaging and likes talking to adults."
He further pointed out that Boy B prefers the company of younger children as they are "less demanding". He described this as "unusual but not deviant in any way."
Boy B had a 'naive belief' that his story would 'get him through', psychologist said
Dr Humphries asked Boy B about a Satanic cult that it was alleged Boy B was involved in to find out if there was anything sinister in it. He said Boy B was "appalled" by his questions and couldn't believe people would believe in things he told him about pentagrams and demonic spirits.
Dr Humphries also explored Boy B's relationship with Boy A. He said Boy B told him that he was afraid of Boy A but he found that Boy A also gave him "kudos" because he was different. Dr Humphries said: "Doing things with [Boy A] made him a bigger presence."
Talking about Boy B's lies during interview he said that boys aged ten to 13 lie a lot and it "often creates chaos". They lie, he said, to protect and then "can't get out of it because they don't have the function to deal with it."
He said memories "shift and change" and just because people contradict themselves does not mean it is evidence of lying.
During his interviews Boy B knew he could end up in jail, Mr Humphries said, and that "terrified him". He had a "naive belief" that his story would "get him through", Dr Humphries said.
Mr Grehan pointed to a part of the doctor's report in which he said Boy B had "no knowledge of a plan for murder and I find no evidence of a motivation for acts of violence."
Mr Grehan said that is what the jury has to decide. He said the report contained a lot of jargon but there "doesn't appear to be any engagement with the facts of the interviews."
Justice Paul McDermott said the jury does not need an expert to say that a 13-year-old would be shocked by witnessing a murder. He said his being scared is an "ordinary human reaction".
He added that it was for the jury to decide why Boy B lied and refused to allow the defence to call Dr Humphries to give evidence in front of the jury.