Megan Newton, 18, was found strangled and stabbed at her bedsit in Fletcher Road in Stoke-on-Trent in April last year.
On what was to be the first day of his trial on Monday, Joseph Trevor admitted murder and two counts of rape at Stafford Crown Court.
Jailing him for life with a minimum term of 22 years for the "appalling crime", Judge Michael Chambers QC said Trevor carried out a "brutal and sustained attack, conducted in a most callous way in her own home".
"On any view she must tragically have suffered, suffered greatly, and suffered for a significant time," he added.
Police had detained Trevor and seized a bag of drugs from him earlier in the night before releasing him, because he was "unfit" for interview, the judge said.
The court heard an allegation of oral rape was made against Trevor when he was aged 15 but never prosecuted.
Trevor, formerly of Danebower Road, Trentham, Stoke-on-Trent, appeared in court wearing a black suit and dark-framed glasses, and sat in the dock just yards from Miss Newton's family.
Opening the Crown's case, Adrian Keeling QC said: "She (Megan) had invited him back as an act of kindness, because he got so drunk on drink and drugs he could not face going home to his parents.
"He raped her, strangled her unconscious and then stabbed her in the back eight times."
"He left her naked on the bed," he added.
Mr Keeling said it had been by chance the two met that night while out at the same nightclub in Newcastle-under Lyme.
Witnesses described Trevor as appearing "fine", but also "quite annoying, loud and drunk", on one occasion "slumped over a female friend" during the evening.
Trevor came to the attention of police after he was spotted by door staff with a bag of ketamine.
"Police seized the bag and told him to come back at some later stage and then let him out of police custody," said Mr Keeling.
Sports coach Miss Newton had been planning to go to university to become a sports therapist, with hopes of a scholarship in the United States.
When the nightclub closed, Miss Newton and Trevor, described in court as "passing friends" at school, found themselves at the same taxi rank.
Trevor, telling friends his parents "would go mad" if he arrived home in his drunken state, was trying to find a place to sleep for the night.
Mr Keeling said: "It was Megan Newton who offered him a bed for the night.
"It was not unusual for her to offer to help.
"It was a typical act of kindness by her but one that cost her her life."
The two arrived in a taxi at her flat in Victoria Place at about 4am.
Mr Keeling said: "At some point in the next 90 minutes, the defendant had sex with her, strangled her unconscious and stabbed her to death - it is uncertain in which order."
He added there was "no evidence the deceased was sexually attracted" to Trevor, although he would later lie telling police he awoke to find her having sex with him.
She was strangled unconscious but "probably alive", when Trevor got a knife from her kitchen, repeatedly stabbing her with such force some of the blows reached her lungs.
Afterwards, CCTV showed Trevor was "remarkably composed", leaving the flat only to find the exit to the housing complex locked.
He returned to Miss Newton's flat, walking past his victim who he had left in "utter indignity" on her bed, to get the key allowing him to leave before throwing the blood-stained fob away.
The court heard that when aged 15, Trevor was accused of orally raping another girl but the matter was never proceeded with, Mr Keeling said.
Just weeks before the murder, in March 2019, the judge was told Trevor had made a suicide attempt because of "depression" stemming in part from that allegation.
His barrister Tim Hannum told the court his client had shown remorse for the "tragedy", in which "two young lives had been destroyed".
In a victim impact statement, her grandmother Beryl Smith read Miss Newton's own personal statement - made during her application for university - in which she described herself as a "sports fanatic".
She said: "I have become more determined and focused - I'll be able to prove myself and everybody around me that I am capable of a lot more."