A teenager has won a High Court victory over the Home Secretary Theresa May's policy of treating 17-year-olds taken into custody as adults - depriving them of protections offered to those aged 16 and under.
Two judges ruled today that the policy was "incompatible" with human rights law.
Those under 16 are entitled to contact their parents or seek advice and assistance from an independent "appropriate" adult.
Today's ruling was a victory for Hughes Cousins-Chang a sixth-form college student from Tulse Hil, south-east London, who was arrested by Metropolitan Police but subsequently found to be innocent.
He was detained for more than 12 hours and strip searched at a police station after being suspected of a robbery.
A Home Office spokesman said: "The Government believes the welfare and protection of all those held in police custody, especially young people, is extremely important. We accept the court's judgment and will consider the next steps we should take to implement the changes."
The ruling follows the high profile deaths of two 17-year-olds, Joe Lawton and Edward Thornber, who killed themselves after getting into trouble with police.
Joe's parents, Nick and Jane Lawton, say that their son would "still be here today" if he had received their support when he was taken into custody for drink driving.
The court lifted the anonymity order on Hughes, now aged 18, at the end of their ruling. His mother is Carrlean Chang. Hughes brought today's landmark challenge with the help of his uncle Christopher Chang.
In his ruling Lord Justice Moses, sitting with Mr Justice Kenneth Parker, said: "I conclude that it is inconsistent with the rights of the claimant and his mother, enshrined in Article 8 (of the European Convention on Human Rights) for the secretary of state to treat 17-year-olds as adults when in detention."
To do so "disregards the definition" of a child in the UN Convention on the Rights of the Child, and the "preponderance of legislation affecting children and justice", said the judge.
Earlier, Mr Lawton told BBC Breakfast: "If we get the change that we are looking for now, it would have meant that we could have been there to support Joe while he was in the police station and explain to him 'It is not the end - we can get through this, we can help you and make sure that your future is as bright as you expected it' ."
The change in law has received backing from the Association of Chief Police Officers but is still rejected by Policing Minister Damian Green, Mr Lawton said.
Joe, from Stockport, Greater Manchester, was arrested when police stopped him after he decided to drive his new car home from a party.
He was kept overnight at Cheadle Heath police station in Greater Manchester without his parents' knowledge.
Two days later he took his own life, using the shotgun from the family farm.
Ann Thornber, Edward's mother, said her son had been sent a court summons "in error" rather than a final warning for possessing 50p worth of cannabis.
"If we had been told and had been informed we would have been able to support Edward going through that crisis and to reassure him that it was a mistake," she said.
"He was 17 and he was being treated as an adult when in theory he wasn't, he was a 17-year-old."
Lacrosse star Edward, from Didsbury, Greater Manchester, was found hanged on 15 September 2011.
The parents of two 17-year-olds, Joe Lawton and Edward Thornber, who killed themselves after getting into trouble with police, were also at the court for the ruling.
Joe's parents, Nick and Jane Lawton, from Disley, Cheshire, say that their son would "still be here today" if he had received their support when he was taken into custody for drink driving.
An emotional Mrs Lawton said: "We are obviously very pleased with the ruling. We knew right from the first moment that if we had been there it could have all been very different.
"We are so pleased, but it is also tinged with such sadness and devastation."
Mr Lawton, clutching a large photograph of his son, said: "The judge did say that this law should have been changed in 2010."
He said all of their rights had been "breached".
Mr Lawton stressed: "They need to change this today. They need to get on the telephone right now. There should be someone ringing every police station and telling them that today, 17-year-olds have the right to have an appropriate adult."
Edward's mother Ann Thornber, from Manchester, also holding a photograph of her son, said: "It's just so difficult. Obviously we are delighted that some good has come out of it, but it's not going to bring Joe or Edward back.
"If it can stop another family going through the devastation we have been through, there has to be something positive.
"The tragedy is that Edward and Joe would still be here today if the law had been changed in 2010 but it never happened and now we are suffering the consequences of that."
The boy at the centre of the case, Hughes Cousins-Chang said outside court: "I am very pleased. It's been a long journey."
His mother Carrlean added: "I'm really, really proud of my son."
Lord Justice Moses described how, four weeks after his 17th birthday - at 3.55pm on April 19 2012 - Hughes was arrested on suspicion of robbery of a mobile phone on a bus. He had never been in trouble before.
Shortly after he was taken to Battersea Police Station "he asked that his mother be informed".
That was not allowed, said the judge. "She did not learn that he was in custody for about four-and-a-half hours after he had been arrested.
"She was not allowed to speak to him. The claimant was released after 11 hours in custody."
One month later he was informed by letter that his bail was cancelled. No charges were ever brought against him.
The judge said the arrest and detention in custody occurred under Code C of the Code of Practice under the Police and Criminal Evidence Act 1984, which permitted a 17-year-old to be treated as an adult.
This, he declared, was "an anomaly" in the criminal justice system and breached Article 8 of the European Convention on Human Rights, which safeguards an individual's right to a private and family life.
The Home Secretary's position was that there was "no imbalance between a 17-year-old and the criminal justice system such as to require, for example, a parent to be informed or the assistance of an appropriate adult," said the judge.
"The question, she suggests, is not whether a civilised justice system should afford a juvenile and a child special protection, but rather whether a 17-year-old ought to fall within the scope of that assistance."
The judge declared: "The need to include 17-year-olds within the scope of those afforded special protection in custody seems almost unanswerable."
He said the Home Secretary did not seek to justify the anomaly - "she merely says that she does not need to in the light of Parliament's persistence in treating 17-year-old detainees as adults".
The judge said: "It is difficult to imagine a more striking case where the rights of both child and parent under Article 8 are engaged than when a child is in custody on suspicion of committing a serious offence and needs help from someone with whom he is familiar and whom he trusts, in redressing the imbalance between child and authority.
"The wish of a 17-year-old in trouble to seek the support of a parent and of a parent to be available to give that help must surely lie at the heart of family life which, quite apart from Article 8, the Government seeks to maintain and encourage.
"Once it is accepted that Article 8 is engaged then treatment of a 17-year-old as an adult seems to me to be not capable of justification.
"I conclude that it is inconsistent with the rights of the claimant and his mother, enshrined in Article 8, for the secretary of state to treat 17-year-olds as adults when in detention.
"To do so disregards the definition of a child in the UNCRC, in all the other international instruments to which the Strasbourg Court and the Supreme Court have referred, and the preponderance of legislation affecting children and justice which include within their scope those who are under 18.
"The secretary of state's failure to amend Code C is in breach of her obligation under the Human Rights Act 1998, and unlawful.
"This case demonstrates how vulnerable a 17-year-old may be. Treated as an adult, he receives no explanation as to how important it is to obtain the assistance of a lawyer.
"Many 17-year-olds do not believe they need any guidance at all. They demonstrate all the youthful arrogance of which many parents are aware.
"All the more need, then, for help and assistance from someone with whom they are familiar.
"If, at the heart of any policy in relation to 17-year-olds, lie the objectives of reinforcing strength of family ties, and development into a responsible adult with the assistance of a responsible parent, it is hard to see what Code C, in its treatment of 17-year-olds as adults, achieves other than to undermine such objectives.
"I conclude that the Secretary of State acted in a way which was incompatible with Article 8 of the Convention in failing to revise Code C so as to distinguish between the treatment of an adult detainee and a detainee under the age of 18.
"Article 8, read with UNCRC, requires a 17-year-old in detention to be treated in conformity with the principle that his best interests were a primary consideration."
Director of charity Just for Kids Law, Shauneen Lambe, said later: "Today we are proud and sad. Proud for Hughes - that a 17-year-old stood up and said I don't think this is right and took it to court - and proud that so many people's hard work has gone into changing the law."
The sadness was for the "terrible loss" the families had to go through and that the Home Secretary did not change the law before the case got to court.
"Our pressing concern is how this protection can be implemented to protect 17-year-olds from today.
"We have asked the Home Secretary to issue immediate guidance to police forces around the country before she begins her consultation."
"We would be happy to assist in the drafting of this. We are of course anxious to make sure another tragedy doesn't happen in the interim."
Penelope Gibbs, chair of the Standing Committee for Youth Justice, commented: "The Standing Committee for Youth Justice is very pleased that the court has decided that it is unlawful to treat a 17-year-old, who has been arrested, differently to a 16- year-old.
"17-year-olds are children and need help and support when accused of committing a crime. We hope the Government will move swiftly to change the law".
Tabitha Kassem, legal director at the Howard League for Penal Reform, said: "This important judgment is most welcome but overdue. As we argued in this case, it is an established legal principle, enshrined in our own laws as well as the UN Convention on the Rights of the Child, that 17-year-olds are children.
"The Howard League has joined in calling on the Home Secretary to revise the Codes of PACE to give 17-year-old children this basic safeguard for years, but this has been persistently refused. It is deeply disappointing that it has taken this litigation, the intervention of two charities, and the continued suffering of 17-year-olds, some of whom have taken their own lives post release from police custody, to have this legal anomaly recognised as unlawful.
"Allowing 17-year-olds the right to this protection is not complicated or unduly expensive; in fact, Avon and Somerset Police already provide 17-year-olds with access to an appropriate adult as a matter of course. We are delighted to see that the Association of Chief Police Officers has announced its support for a change in the law, and we hope that the Home Office will respond appropriately."
She said: "It is essential that where a government or other public body has acted unlawfully a judge can hold them to account, as was the case here.
"The current proposals will inhibit access to justice and weaken the accountability of the executive without achieving the aims of speed and efficiency, at the cost of the most vulnerable in our society."
Carolyn Hamilton, of the the Coram Children's Legal Centre, said: "We are very pleased with the judgment and the Coram Children's Legal Centre now calls on the UK Government to rectify this unlawful, discriminatory anomaly in the criminal justice system and its codes of practice, to bring them into line with children's rights without delay."