DNA was found on Alesha MacPhail's body which matched the 16-year-old accused of her murder, a court has heard.
Forensic scientist Stuart Bailey told the jury that the odds of the intimate samples belonging to anyone else were more than a billion to one.
The teenager denies abducting, raping and murdering six-year-old Alesha.
Her body was discovered in a wooded area on the Isle of Bute on 2 July last year.
The High Court in Glasgow previously heard Alesha suffered 117 injuries and died from significant pressure being applied to her face and neck.
Stuart Bailey is the last prosecution witness to be called in the case by Iain MacSporran QC.
The Scottish Police Authority forensic scientist authored or co-authored three reports on the case.
Mr Bailey visited the crime scene, the flat on Ardbeg Road from where Alesha was abducted, and the home of the accused. He also examined clothing found on the shoreline.
The court heard DNA samples from the accused, his mother, Alesha's grandparents, her father and his girlfriend were taken for comparative purposes.
The jury was told various samples were taken from the child's body.
Mr Bailey said the accused's DNA was detected on the front of Alesha's neck.
The odds of it being from anyone else were more than one in a billion.
Traces from the accused were also found on the back of her neck and her face, but those samples were not subject to a statistical forecast.
A match for the accused's DNA was also detected on 14 parts of Alesha's body, including bruising.
Given the volume of samples, Mr Bailey said it was "highly unlikely" they had got on the child through anything other than direct contact.
The court also heard samples of the accused's DNA were detected on some of Alesha's clothing, which had been discarded next to her body.
Mr Bailey later told the jury that DNA matching the accused was recovered from a pair of jogging bottoms found on the shoreline, intertwined with a pair of boxer shorts.
The court heard the recovery of forensic material from the clothing had been hampered by their immersion in salt water.
But the witness said a DNA sample was recovered from the inside seam of the waistband of the jogging bottoms.
He told the jury the odds of it being from anyone other than the accused was more than a billion to one.
The court heard a knife found on the beach opposite Alesha's grandparents' home on Ardbeg Road and a hooded top discovered further along the shoreline were also examined.
No blood or DNA was found on either the knife or the hooded top.
Mr Bailey said the top was deemed insufficient for DNA recovery as it had been immersed in salt water and then dumped in a skip.
Under cross-examination by Brian McConnachie QC, Mr Bailey said no traces of Alesha's DNA were found in the accused's home.
The court also heard that no traces of the accused's DNA were recovered from Alesha's grandparents' home.
Alesha, from Airdrie in North Lanarkshire, was only days into a summer break in Rothesay when she was killed.
The teenager has lodged a special defence claiming the crime was committed by 18-year-old Toni McLachlan, who is the girlfriend of the victim's father.
The court previously heard that the accused claimed he had sex with Ms McLachlan, and that she then planted his DNA - from a used condom - at the scene.
In previous evidence, Ms McLachlan insisted she did not have sex with the accused and had nothing to do with Alesha's death.
The defence case is expected to get under way on Tuesday afternoon.
The trial, before judge Lord Matthews, 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.
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.