Jamie King offered to walk 14-year-old home before subjecting her to a sex ordeal in his home city of Aberdeen.
King, who was aged 17 at the time, grabbed hold of the girl who had drunk half a bottle of vodka and took her bag and mobile phone.
He seized her hand and forced her to perform a sex act before pushing her onto her knees and raping her.
He had earlier denied assaulting and raping the teenager on October 5 in 2013 at Queen Street and the rear of shop premises at Great Northern Road, Aberdeen, while she was intoxicated with alcohol, but was found guilty at a trial.
A judge at the High Court in Edinburgh told him: “Your victim was a 14-year-old schoolgirl who was a stranger to you.”
Paul Arthurson QC said: “You left the scene leaving her weeping and distressed.”
The judge told King: “You have demonstrated no signs of remorse or regret for your actions.”
“Such is the gravity of the offence of rape of which you have been convicted that there is no alternative to a substantial custodial sentence,” he said.
The judge said he had concluded that King, now 20, represented “a high risk of causing serious harm”.
He sentenced him to six years detention and ordered that he be kept under supervision for a further two-year period.
King was told that he would be on the sex offenders’ register indefinitely.
King was also convicted of stealing the mobile phone, bag and its contents during the incident.
He was previously acquitted of assaulting and raping a second 14-year-old girl, who was also intoxicated with alcohol, on January 4 in 2013 in Aberdeen, on a not proven verdict at his earlier trial.
The victim in the October attack said she had met up with a friend and they had bought vodka before going to a park to drink it.
She said it was not the first time that she had done this and they would ask a passerby to make the purchase.
She said she and her friend drank half the bottle each but they had an argument and the other girl left heading towards her home.
The teenager said she was on Great Northern Road when she came across a male who was “ginger”. She said: “He was just standing there on his own.”
She said she had asked him for a cigarette and made out she 16 in the hope that he would give her one, but he said he did not have any.
She told the court: “I think I was very drunk because I would not normally walk up to some guy standing near a bar and ask him for a cigarette.”
The victim said she thought it was obvious she was drunk and added: “I wasn’t walking straight and I was like lisping, not talking the right way.”
Defence counsel David Moggach said that although the victim was 14 at the time she had accepted that she passed herself off as being a 16-year-old.
He said: “This was not premeditated, this was not planned. It was a chance meeting.”
The defence counsel said that King, formerly of Nigg Kirk Road, Aberdeen, had a “troubled upbringing” and had been taken into local authority.
He said a background report prepared on had described him as well-mannered, co-operative and easy to deal with.