A judge has expressed dismay at having to give absolute discharges to three rioters whose custodial sentences have been overturned on appeal.

The trio had all been made the subject of 18-month detention and training orders by Bradford Youth Court. But a Court of Appeal ruling last month meant they should not have been locked up for their part in last July's rioting.

That ruling, in another rioter's case, concluded that a defendant's age at the time he committed the offence should determine the sentence.

As the three youths, who cannot be identified for legal reasons, were 14 and of previous good character they could not be sent into custody for the offence of riot. The boys' appeals against their youth court sentences were allowed yesterday by Judge Roger Scott and two magistrates sitting at Bradford Crown Court.

Although the teenagers could have been given referral orders in place of their detention and training orders, Judge Scott said he and the magistrates did not think that would be appropriate because they had already served some time in custody.

Judge Scott conditionally discharged the youth who had spent the shortest time in custody for nine months, and imposed conditional discharges of three months on the other two - but was later informed he did not have the power to do that. Judge Scott eventually substituted absolute discharges for all three, but described the situation as a "sentencing morass''.

A teenager, who was 16 at the time of the riots, has had his 18-month detention and training order reduced on appeal to a year.