Aaron Campbell, 16, confessed to the abduction, rape and murder of six-year-old Alesha MacPhail before his sentencing on Thursday morning.
During his trial, the teen had repeatedly denied the crimes, which took place last July on the Isle of Bute, Scotland.
Campbell made the confession during interviews with a criminal justice social worker and a clinical psychologist for reports, his lawyer told the court.
He was handed life imprisonment with a minimum term of 27 years.
The sentencing, which took place at the high court in Glasgow, was streamed live.
Judge Lord Matthews said Campbell had not demonstrated a "flicker of emotion" during the trial.
Sobs could be heard from the court's gallery as the judge passed sentence.
On the night of MacPhail's murder he said that Campbell told the psychologist he had been drinking and wanted to buy cannabis, so went to her father's home.
The six-year-old's father had sold him the drug before.
The teenager told the child to believe he was a friend of her father's and that he was taking her home, the psychologist said.
Campbell then carried MacPhail to a secluded area, Judge Matthews said.
"I will not go into the horrific and cold-blooded details of what you said you did to her," he added.
After the teenager murdered MacPhail he said he threw his blood-stained clothes into the sea and went home to take a shower, only to return to the place where he had left her body to retrieve his phone.
The clinical psychologist reported that Campbell told him in the days after the murder he was "totally unconcerned" other than to be amused that the police had not arrested him.
Judge Matthews told the court how the 16-year-old had posted an image of himself on social media while making a joke that he had found where the murderer was hiding.
He added said the "arrogance and callousness" of Campbell's actions was "breathtaking".
The teenager put in a special defence naming the girlfriend of MacPhail's father as the killer during his trial at the High Court in Glasgow last month, giving evidence in support of the claim.
The judge labelled this a "cruel travesty of the truth" which left 18-year-old Toni McLachlan open to suspicion with the possibility of hatred.
In his conclusions, the judge said that it was obvious to him that reintegration or rehabilitation were "remote possibilities".
He said the reports painted a picture of Campbell as a "cold, calculating, remorseless and dangerous individual".