A teenage boy who throttled a 10-year-old girl as she played in a street and repeatedly beat her around the head so viciously he could have killed her has been locked up indefinitely.

Connor Hodgson, 16, said he had no idea why he had attacked the youngster, who passed out and was found covered in blood after a police search in Stockton, Teesside, in April. He said he could not even remember carrying out the assault.

The girl, who cannot be named, was left with serious physical and psychological problems, including post-traumatic stress disorder, Teesside crown court heard.

The judge, Peter Fox QC, told Hodgson he represented such a significant risk to the public that he could not say if he would ever be released from custody.

Hodgson, who was in foster care, talked to the girl as she played outside and offered to help her find her bike, Tony Hawks, prosecuting, told the court. They went to a street in Stockton's Riverside area, away from her home, where the attack is believed to have taken place.

Hodgson wrapped his hands around her neck and applied "severe force", Hawks said. "She said that the defendant had put his arm around her neck and said he'd prevented her from breathing. She said that at that point she had gone to sleep, as she put it, and when she woke up the defendant wasn't there. She reported to have no recollection of the sustained assault the defendant must have carried out."

The victim's mother reported her missing and police started a search. She was found about two hours later, Hawks said. "She was confused, unsteady on her feet and covered in blood."

A doctor who examined her said she had multiple cuts and bruises due to "severe blunt force", and concluded: "In my opinion, these injuries represent at least seven blows to the back of the head, four to the face, with pressure to the neck. The head injuries and pressure to the neck were potentially fatal."

Hodgson was arrested after CCTV showed him with the girl. He pleaded guilty to grievous bodily harm with intent at a previous court hearing, and denied a charge of kidnap, which was accepted by the crown.

Duncan McReddie, representing Hodgson, said the defendant deserved credit for a guilty plea. He said Hodgson had been affected by "adverse childhood experiences" and was immature. "He does find it very difficult to accept he was the person who conducted the offence in this way," McReddie said.

The victim's mother described her daughter as a clever, beautiful girl who knew about the dangers of speaking to strangers. She had made a good recovery but had "ongoing physical and mental problems" including extreme phobias, the court heard.

Due to the severity of the case, the judge overturned a court order that would have banned identification of Hodgson. Fox said: "Your dreadful attack on her caused the most serious injuries in a number of ways, some of which were life-threatening.

"Not only was she vulnerable by being so much younger and so much weaker than you, but for the most part was helpless by virtue of you rendering her unconscious by strangling her. You now stand convicted of a type of criminal offence and of such seriousness that I must consider whether I'm of the opinion there's a significant risk of serious harm in your case in the future. I do so conclude."

The judge said he had no alternative but to pass an indeterminate sentence with a minimum period of five years for public protection. "He will have to prove he is no longer a threat before he can be released," he said.

Outside court, Detective Inspector Anne-Marie Salwey, the senior investigating officer at Stockton CID, said she was pleased with the verdict but it could not reverse the damage. "The victim fears that he is still going to come back and kill her," she said. "Hodgson has proven to be very dangerous – the public protection aspect of the sentence reflects that."