A man recently released from jail strangled a teenager to death then hid her clingfilm-wrapped body in a wardrobe, a court has heard.
Ashley Foster, 24, denies murdering 17-year-old Megan Bills at a hostel in Brierley Hill, Dudley, on Easter Sunday 2017, but admits preventing the decent and lawful burial of the teenager.
In the first day his trial, Foster claimed the pair had consensual sex together at the hostel three days after he had been released from prison, but she died after asking to be strangled.
However, Crispin Aylett QC, prosecuting, told the jury that that the 17-year-old died in "violent sex attack". He told the court how after stashing her body in the wardrobe, he spent the next few days searching for snuff films on the internet.
He told the court: "That Megan's death must be related to some perverted sexual activity on the part of this defendant which involves actual death or the simulation of death is borne out by the internet searches.
"Snuff being a type of film in which someone can actually be seen to be or appears to be murdered or else to commit suicide or appear to commit suicide."
The jury also heard that while in custody, Foster wrote a letter to his mother admitting to accidentally killing the 17-year-old.
Foster wrote: "She tells me she likes to be strangled. I strangled her and she loved it. But then, as I released her, her eyes closed. I just thought she passed out through the orgasm.
"First I panicked. I wasn't thinking straight. I put her in the wardrobe and I sealed it until I could think of something. I panicked more and more.
He added: "I didn't know what to do. Days passed and I was still panicking, still thinking 'What have I done?' I tried to hide it with the clingfilm like it is done in the films. But it didn't work."
CCTV shows Foster leaving the room two hours after Megan was seen entering, at which point he is believed to have travelled to his sister's house. Megan's body was eventually discovered by staff during a routine room check.
The trial, which is expected to last two weeks, continues.