A woman named by a murder accused as the person who killed six-year-old Alesha MacPhail has denied being involved in her death.
Toni McLachlan was giving evidence during the trial of a 16-year-old boy, who denies abducting, raping and murdering Alesha last July.
The teenager, who cannot be named because of his age, has claimed it was Ms McLachlan who killed Alesha.
Ms McLachlan told the court that she had loved the little girl "to pieces".
And when asked by prosecutor Iain McSporran QC whether she had anything to do with Alesha's murder, she replied: "No".
Alesha's naked body was found in the grounds of a former hotel in Rothesay on the Isle of Bute on the morning of 2 July last year.
Giving evidence from behind a screen at the High Court in Glasgow, 18-year-old Ms McLachlan said she had been dating Alesha's father Robert MacPhail, 26, for about two years.
At the time of the murder she was living with Mr MacPhail's parents in a three-bedroom flat on Ardbeg Road, Rothesay.
She told the court she had dealt cannabis with Mr MacPhail, and had supplied the drug to the accused and his sister.
Alesha was spending the start of her summer break with her father and grandparents at the house when she was killed.
The relationship between Mr MacPhail and Alesha's mother Georgina Lochrane from Coatbridge, North Lanarkshire, had broken down months after she was born.
Ms McLachlan said she only learned on Monday, on the opening day of the trial, that she had been implicated by the accused.
She said she had gone into Alesha's bedroom the night before the killing to turn off the child's TV, which was stuck on the menu page of a Peppa Pig DVD with the theme tune playing.
Fighting back tears, Ms McLachlan said: "She was sleeping and her face was facing the wall and her hair was behind her on the pillow."
She could not recall the time, but said she did not see Alesha again.
The court was told the accused tried to contact Ms McLachlan via Facebook Messenger at 01:47 and 01:48 on 2 July, hours before Alesha was reported missing.
The witness called the accused back at 06:29 as the search for the missing girl got under way. There was no answer, but he messaged her at 09:01 to apologise for contacting her.
Ms McLachlan replied: "Want to keep an eye out for Rabs wee girl please x", with the accused messaging back: "Yh (Yeah) whats happened?"
Ms McLachlan responded: "Shes went missing from house police are looking for her and helicopter is out."
The accused replied: "Oh damn. Am sure she's not went too far x", with Ms McLachlan responding: "Hopefully x".
Alleged domestic abuse
During cross examination by defence lawyer Brian McConnachie QC, who is representing the accused, the court was told Alesha's father, Robert MacPhail, is currently on bail for alleged domestic abuse.
Ms McLachlan confirmed the charge involved her but denied her boyfriend had physically assaulted her - saying the charge followed a heated row after a drinking session following a friend's funeral.
She said she called the police over the incident but confirmed they were still a couple.
Ms McLachlan also denied being jealous of Alesha and telling a friend that the child's death would be "for the best".
And she denied leaving the flat after the accused contacted her at around 01:50 on 2 July, and then having sex with him.
The QC then accused her of returning to the property on Ardbeg Road, abducting Alesha and then murdering her, before planting the accused's DNA, from a used condom, on the child's body.
Ms McLachlan again denied she had anything to do with the murder, before adding that it felt "horrible" to be blamed for the crime "especially when it is somebody you do love so much."
She added: "She knew I loved her and that is what I am trying to keep in my head."
'I've found the wee girl'
The court later heard from Jorge Williams, a member of the public who discovered Alesha's body after joining the search for her when his partner spotted an appeal on Facebook.
Speaking of his shock at finding the lifeless child in a wooded area, he said: "I crouched down and leaned over her and tried to find a pulse."
When he failed to do so, he walked down a path leading to the main road and dialled 999, when he told the operator: "I've found the wee girl. She's dead".
After Mr Williams completed his evidence, judge Lord Matthews told him: "People like you are the salt of the earth and I am very grateful to you for what you tried to do."
Sgt Martin Wilson then described how he was the first police officer on the scene, and was led to the area where the body was found by Mr Williams.
He checked for a pulse on the child's left arm and on her neck, but found no signs of life and said her arm had been "a bit rigid".
The officer was visibly moved during his evidence, and informed the court he had a seven-year-old daughter of his own.
What has the trial previously heard?
Giving evidence on Tuesday, Alesha's father said he had put his daughter to bed at about 22:30 or 23:00 on the night before she was allegedly taken, before going to the bedroom he shared with Ms McLachlan, where they "watched some porn" before going to sleep.
They were woken the next morning by his parents, who told him Alesha was not in her bed. They searched the house before taking the hunt outside to her favourite places, including the local park.
Also on Tuesday, Alesha's grandmother Angela King, 47, told the court Alesha and Ms McLachlan got on "great" and that the youngster called her "Toto".
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.