Phillip Simelane, a psychiatric patient, has pleaded guilty to killing 16-year-old Christina Edkins on a bus.
The 23-year-old admitted manslaughter on the grounds of diminished responsibility.
Simelane, a convicted criminal, who had been released unsupervised despite warning signs over the state of his mental health while in prison, pleaded guilty to killing 16-year-old Christina Edkins after being judged unfit to stand trial at Birmingham Crown Court.
Christina, a pupil at Leasowes High School in Halesowen, was pronounced dead at the scene after being stabbed in the chest on the upper deck of a bus in Birmingham at about 7.30am on March 7.
The killing has led to questions about how Simelane's case was dealt with after his release from prison.
Several members of Christina's family were in court as Simelane, wearing a grey suit, white shirt and blue tie, entered his plea.
Giving the facts of the case, prosecutor Peter Grieves-Smith said: "On March 7, Christina Edkins boarded a bus to go to school and she went to the upper deck and sat in a seat.
"Also on the upper deck was the defendant."
Simelane boarded the bus at 5am, and had been reported by another passenger for sleeping on the back seat.
"Christina Edkins boarded just after 7.30am and went upstairs and sat on her own.
"Within seconds the defendant got up and moved forwards three seats and pulled out the knife, which he then hid."
Simelane then got up and walked forward towards where Christina was sitting, "leant closer to her", stabbed her and started to walk off, the court heard.
"Such was the the nature of the attack, nobody else on the upper deck realised what had happened until Christina reacted," Mr Grieves-Smith said.