Rules allowing police forces to keep the fingerprints and DNA samples of innocent people are unlawful, says the UK Supreme Court.
The decision comes nearly three years after the European Court of Human Rights came to a similar conclusion.
Judges said government plans for changes to the law in England and Wales were already in the pipeline.
The ECHR ruled that the guidelines did not differentiate between criminals and people who had never been convicted.
The 1984 Police and Criminal Evidence Act required the destruction of samples and fingerprints "taken from a person in connection with the investigation of an offence if he was cleared".
When the law changed in 2001 it gave police the discretion to keep samples "after they have fulfilled the purposes for which they were taken".
The Association of Chief Police Officers (Acpo) issued guidelines saying data should be destroyed only in "exceptional cases", said judges.
But the panel of seven Supreme Court justices concluded, by a five to two majority, that the Acpo rules were unlawful because they were incompatible with privacy aspects of the European Human Rights Convention.
The Supreme Court made its ruling in allowing appeals by two men who said police in London had unfairly retained their fingerprints and DNA samples.
The ECHR made its 2008 ruling when two men from Sheffield contested South Yorkshire police's right to hold their DNA details after the House of Lords, then the highest court in England, rejected their appeals there.
The House of Lords concluded then that the retention of DNA samples did not breach European human rights privacy law.
The Supreme Court judges said this latest decision did not affect Scotland where, within its own legal system, samples can be kept only for a limited period and only for certain crimes.
They said UK government ministers planned to create new laws, in the Protection of Freedoms Bill, to bring England and Wales into line with Scotland.
In the judgement, Lady Hale, one of the Supreme Court justices, said the decision to adopt Scotland's system was likely to be welcomed.
She said: "It reflects a strong popular sentiment that the police should not be keeping such sensitive material relating to 'innocent' people, even if they are allowed to use it 'for purposes related to the prevention or detention of crime, the investigation of an offence, the conduct of a prosecution'".
She added: "If the popular press is any guide to public opinion, the (2008) decision of the European Court of Human Rights... is one which captures the public mood in Britain much more successfully than many of its other decisions."