The teenager accused of murdering six-year-old Alesha MacPhail once told a friend he “might kill 1 day for the lifetime experience”.
A 16-year-old girl said he made the comment in a Facebook Messenger chat after she started a conversation about a crime documentary.
The witness told police about the post, from 2017, after the 16-year-old boy was arrested.
The boy denies abducting, raping and murdering Alesha on 2 July last year.
He cannot be named because he is under the age of 18.
It is alleged that Alesha was taken from the home her grandparents shared with her father on the Isle of Bute.
A post-mortem examination revealed that the child suffered 117 injuries – although the court previously heard some could have been caused by vegetation in the area where she was found.
She died from significant pressure being applied to her face and neck.
Another 16-year-old girl told the High Court in Glasgow , the accused sent a selfie-style video to a Snapchat group with the message: “Found the guy who has done it.”
The girl said that post was sent hours after Alesha’s body was discovered in a wooded area on the island.
The witness said it was posted to about 25 young people who were part of the Snapchat group.
The jury heard the silent footage was shot in a bathroom and featured the top half of the accused’s body but not his face.
The second young witness, who messaged the accused about the crime documentary, also said he privately contacted her just three hours after Alesha was found dead.
She said: “During the conversation he started to get anxious and he said the police were going to blame it on him.”
Under cross examination by Brian McConnachie QC, for the accused, said she accepted the conversation about killing someone was “fantasy”.
The trial went on to hear from another friend, who said the accused was “feeling suicidal” hours before Alesha’s body was found.
He said the accused hosted a party at the home he shared with his parents on 1 July last year which was attended by about 15 people.
The 16-year-old witness said the party broke up after midnight but he went back to the accused’s house to get his bag.
He told prosecutor Iain McSporran QC his friend was lying in his bed and was not in good state of mind.
He told the witness he was concerned about his mother’s drinking.
The teenager added: “He was telling me he was depressed and he was thinking about harming himself. I felt quite worried for him.”
‘Dark sense of humour’
The witness asked the accused if he wanted him to stay the night or if he wanted to stay at his house, which was nearby, but he declined.
He said the boy seemed to be better by the time they parted company.
The witness, who got home at about 01:30, added: “He told me he was going to get stoned and go to his bed.”
The teenager also told the court the accused was wearing grey jogging trousers and a black Nike zip-up hoodie.
The boy was also a member of the Snapchat group that received a video from the accused, hours after Alesha’s body was found.
His recollection is that the footage featured the accused’s voice, as opposed to a text caption.
The jury were told the boy was heard saying: “I have found where the murderer was hiding.”
He then pointed to himself in the bathroom mirror.
Under cross examination, the boy was questioned further by Mr McConnachie about the accused’s demeanour when he returned to the house after leaving the party.
The witness said: “He said he was feeling suicidal.”
The teenager and another young witness told the court the accused was physically strong and lifted weights at home and in the gym.
The jury also heard evidence that the boy had a “dark sense of humour”.
Two of three men contacted by the accused in a bid to source cannabis gave evidence and confirmed they received messages from him the early hours of 2 July.
But, like Alesha’s father Robert MacPhail, they confirmed they did not meet the accused in the early hours of that morning to supply him with the drug.
The court previously heard that a boy’s hooded top was discarded in a skip despite being recovered on a shoreline days after Alesha’s body was found.
The trial heard that dog walker Zareya MacGillivray contacted police on 6 July last year after spotting the black Nike youth XL garment on the Isle of Bute.
It was recovered by Sgt Anthony Hannah, using gloves and an evidence bag.
But the jury heard the officer later put it in a skip behind Rothesay Police Station after consulting with a colleague.
Sgt Hannah said the discovery came after the arrest of the 16-year-old suspect.
He added: “At that time we had no information that there was anything outstanding from the inquiry.”
Under cross examination by Brian McConnachie QC, for the accused, he denied his actions had been “reckless”.
Sgt Hannah told the court the top was found about half a mile outside the designated parameters set by search advisers for the investigation.
It was removed from the skip when the inquiry team was made aware of it.
The court also heard about a knife that was found on the shore opposite Alesha’s grandparents’ house.
Coastguard volunteer Peter Morrison, 39, from Rothesay, told the court he was called out to carry out a shoreline search at 06:55.
He said that opposite the house where Alesha had been staying, he found “what looked like a kitchen knife”.
Mr Morrison said he did not touch the knife – which he believed had been in the sea and left onshore by the receding tide – but noted its location before continuing to search for Alesha.
He later told police who cordoned off the area.
The accused teenager has also been charged with attempting to hide evidence.
He has claimed it was Toni McLachlan, the partner of Alesha’s father, who killed the child.
During her evidence to the court on Wednesday, Ms McLachlan insisted she had nothing to do with Alesha’s death, telling jurors: “I loved her to pieces.”
Before the case adjourned for the day, Mr McSporran told the court he expected to conclude the prosecution case by Tuesday.
Why is the BBC not naming the accused?
It is illegal in Scotland to publish the name, address, school or any other information which could identify anyone under the age of 18 who is the accused, victim or witness in a criminal case
This law applies to social media as well as to websites, newspapers and TV and radio programmes.
However, the name of victims who have died can be published – so the BBC and other outlets are able to identify Alesha MacPhail.
How can an accused blame someone else for the crime?
Ahead of their trial, the accused can lodge a special defence such as self-defence (they were defending themselves from attack), alibi (they were somewhere else when the crime was committed) and mental disorder (the accused is not responsible for their actions because they were suffering from a psychiatric condition).
In this case, the accused has lodged a special defence of incrimination, which means he has claimed that someone else (Toni McLachlan) was responsible.
However, the Crown must still prove the guilt of the accused beyond reasonable doubt. There is no onus on the accused to prove their special defence is true, and he or she can still be acquitted even if the jury does not believe their special defence.