Jurors in the Alesha MacPhail murder trial have heard that her father sold cannabis to the teenager accused of killing her.
Robert MacPhail admitted doing deals with the 16-year-old boy who lived on the Isle of Bute.
The teenager – who cannot be named because of his age – denies abducting, raping and murdering Alesha last July.
He has lodged a special defence claiming the crime was committed by a woman called Toni Louise McLachlan.
Jurors were earlier shown pictures of the crime scene.
Prosecutor Iain McSporran QC issued a warning to the jury before the images of the six-year-old with a pile of clothing next to her were shown on public screens in the High Court in Glasgow.
The images also showed the wooded area and the disused hotel on the Isle of Bute where she was found.
A number of people, including relatives of Alesha, left the court before the pictures were shown.
They included photographs and 360-degree images of the wooded area between High Road and Gortans Road on Rothesay, where the body was discovered.
The jury were also shown interior images of the attic conversion flat on Ardbeg Road, where Alesha was staying.
Jurors were previously told Alesha’s naked body was found by a man at 08:54 on 2 July in the grounds of the former Kyles Hydropathic Hotel.
The court also heard it was Alesha’s grandmother Angela King who had reported the girl missing at 06:23 on 2 July.
Prosecutors allege the accused boy was armed with a knife when he took Alesha from her bed at a house in Ardbeg Road.
It is claimed he then carried the schoolgirl to the site of the former hotel.
The indictment states he took off Alesha’s clothes, shook her violently before placing his hands over her nose, mouth and around her neck.
The boy is said to have “applied pressure” to her face, inflicted injuries by “means unknown” with prosecutors alleging he went on to rape and murder Alesha.
The teenager faces a separate charge of attempting to defeat the ends of justice.
It is alleged he went to another house in Ardbeg Road before disposing of the clothes he had worn and then taking a shower to remove blood from his body.
This is said to have been done in a bid to “destroy or conceal evidence”.
The trial continues.
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.
What is a special defence of incrimination?
Ahead of their trial, the accused can lodge a special defence which will result in them being acquitted if it is accepted by the court.
These defences include 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 – meaning he has claimed that someone else (a woman called Toni McLachlan) was responsible for Alesha’s death.
It will be for the jury to decide whether or not they accept this special defence after hearing the evidence in the case.