Magistrates must refer all first-time offenders aged under 18 to the new youth offenders panels.
This results from the lords accepting a commons amendment when the Youth Justice and Criminal Evidence Bill returned to the second chamber.
The lords, where the measure started, voted in favour of an amendment proposed by eminent lawyers, including former lord chief justice Lane, which would give the courts discretion on whether to refer young offenders to the panels. They argued that mandatory sentencing
However, peers accepted a commons amendment making referal mandatory when first-time offenders pleaded guilty.
The offenders referred to a youth panel will have to attend meetings and agree a programme of activity designed to punish and rehabilitate.
The lords accepted all the commons amendments, including one which will make all child witness eligible to give evidence on video - as is almost routinely done at present in cases involving sex or violence. It will be for the courts to decide what special measures would improve the quality of a young person's evidence.
The Bill returns to the commons to formally complete it parliamentary passage.