A schoolboy who admitted giving a savage beating to a friend, who will never make a full recovery, can only be given a maximum six months behind bars after a test case ruling.

The 18-year-old, from Durham, attacked his friend after drinking six or seven cans of beer at a school leavers' party on the last day of term, in July last year.

London's High Court heard that the youth admitted punching his friend four or five times before repeatedly kicking him as he lay on the ground.

The victim suffered a ruptured spleen, which had to be removed during a six-day stay in hospital. He will be susceptible to infections and will have to take antibiotics daily for the rest of his life.

The attacker admitted inflicting grievous bodily harm, at Chester-le-Street Magistrates' Court last August, but is still awaiting sentence.

The Director of Public Prosecutions (DPP) took the case to the High Court after magistrates refused to send him to the crown court for sentence.

By deciding to deal with the case themselves, the magistrates effectively limited the sentence to a maximum of six months. If he had been sent to the crown court, a sentence of two years would have been likely, with a maximum of five years.

Shaun Dodds, for the DPP, told the High Court that the magistrates' decision to deal with the case was "truly astonishing". He said that, in a police interview, the 18-year-old had himself described the attack as "savage".

But Bernard Richmond, for the youth, described it as a case of "schoolboy horseplay gone horribly wrong", which he had admitted immediately. He had also shown genuine remorse.

Dismissing the DPP's application, Mr Justice Henriques said that, had it not been for the damage to the victim's spleen, this would have been a case of actual, rather than grievous, bodily harm.

Pre-sentence reports on the boy were "thoroughly favourable' and he posed a very low risk of re-offending.

Although he did not want to pre-empt the sentencing decision that must now be made by the magistrates, the judge said it was at least arguable that the youth should not be given a custodial sentence.