The man accused of murdering schoolgirl Tia Sharp took a photograph of the naked 12-year-old dead on her bed, the Old Bailey has heard.
Stuart Hazell, the former boyfriend of Tia's grandmother, allegedly had a sexual attraction to the schoolgirl, a jury was told.
Her body was found in the loft of her grandmother's south London house last August, a week after she went missing.
Mr Hazell, 37, of New Addington, south London, denies murder.
Prosecutor Andrew Edis QC showed jurors an image of a child alleged to be Tia, although the girl's face cannot be seen, on her bed at her grandmother's house.
The prosecution case is that
Stuart Hazell had a sexual
attraction for Tia Sharp, that
there was some form of sexual
Andrew Edis, QC Prosecutor
Blood could be seen on the bed linen in the picture, said to have been taken in the early hours of 3 August, when prosecutors say Tia died.
The court heard Tia had used Blackberry messaging, or BBM, on her mobile phone to speak to a friend until 00:42 BST on 3 August.
"After that, the prosecution say, she did not use her mobile phone ever again," Mr Edis said.
He said it seemed sensible to suggest she had died after that time, and told the court the photograph of her allegedly dead on the bed was taken at 03:00 BST at the earliest - more likely at about 06:00 BST that day.
A pathologist who examined the body, as well as the photograph, said marks on Tia's body suggested she had been moved after she died, and "posed" into the position seen in the photograph, Mr Edis said.
He told the jury: "The prosecution case is that Stuart Hazell had a sexual attraction for Tia Sharp, that there was some form of sexual assault, something of that kind, and that was the reason he killed her."
The court heard two memory cards were found in the house, one in the kitchen and one, hidden on top of a doorframe, which contained "extensive pornography" featuring young girls.
There were also three video clips of Tia sleeping in her bedroom and 11 still images of her sleeping.
Another image showed a young girl lying naked on Tia's bed, and there were "professional" pornographic images of young girls performing sex acts, the jury heard.
Mr Edis said internet history on Mr Hazell's phone showed searches of a website that was popular with paedophiles.
He said Mr Hazell had also visited a pornographic website on 6 August - while Tia's body was in the loft.
Mr Edis told jurors they will have to decide whether Mr Hazell is guilty of murder, or whether Tia died in an accident.
He warned them they will find some of the evidence in the trial, which is expected to last nearly three weeks, "distressing".
Mr Edis told the jury the loft had been inspected by police twice before Tia's body was found.
"They only found it, I am afraid, because it had started to smell," he said.
"It was quite well hidden. It has been moved up and then across within the loft space."
He said the girl's body had been "carefully wrapped" in a sheet first and then bin bags, before being sealed with tape.
Mr Hazell denies killing the schoolgirl between 2 August and 10 August, when her body was found.
The case continues.