Kayleigh Haywood, from Measham in Leicestershire, was found dead last November.
Stephen Beadman, 29, of George Avenue, Ibstock, admitted raping and murdering the teenager at a hearing in April.
He and Luke Harlow, 27, also of George Avenue, are on trial at Nottingham Crown Court after both denied a charge of false imprisonment.
Harlow had also previously pleaded guilty to sexual grooming and two counts of sexual activity with a child.
Miranda Moore QC, prosecuting, told the jury that Kayleigh went willingly to Harlow's flat in Ibstock, Leicestershire on 13 November.
She believed they were in a "secret relationship" after chatting on Facebook for about a fortnight, the court heard, and had told her family she was staying with her best friend.
Harlow - who called himself "Luke Fun Times Harlow" online - told the teenager she was his "princess" who he would "love and treasure forever".
"On that night Kayleigh had been given substantial amounts of alcohol and she had been sexually touched by Luke Harlow," said Ms Moore.
"She was underage and he knew it.  He was later to lie about that, pretending to people that she was much older."
Ms Moore said the false imprisonment charge centred around what happened to Kayleigh between 21:00 and 03:00 BST on 14 and 15 November.
Both men are alleged to have held Kayleigh against her will.
The jury heard that at one point, Kayleigh had tried to escape Harlow's flat and was seen by a witness leaving the property naked from the waist down.
"What happened to her in that property to make her flee into the night?" Ms Moore said.
"What we know is that she was chased by Mr Beadman and pinned to the ground. This was seen by somebody from their upstairs window.
"At some point, far from being this drunken, compliant girl, Kayleigh became somebody who wanted to get out of that flat."
Ms Moore said that the witness mistook Beadman for a policeman.
Beadman then took her "off into the night, where she was raped and murdered by him".
After Beadman had been by interviewed by police for three days and directed officers to a location on the outskirts of Ibstock.
Her body was then discovered in thick undergrowth near a stream.
Following examinations of Harlow's phone, police discovered he had sought to groom other girls.
His intention was to kidnap them, get them drunk, have sex and keep them in his flat, the jury was told.
"Kayleigh Haywood was not the only girl Luke Harlow groomed," Ms Moore said. "She was the last in the line."
He has also admitted attempting to meet two other underage girls for sexual purposes.
Police from across the East Midlands helped with the hunt for the teenager after she went missing on 13 November.
A passerby found Kayleigh's smashed phone on the ground in Ibstock. The last number she had dialled was the number of the friend she said she was staying with.
An inquest heard she died from head and facial injuries.
The trial - which is expected to last until next week - continues.
A 15-year-old girl was seen fleeing a house half-naked before a man chased, raped and murdered her, a court heard.