Today the Strasbourg judges said keeping the DNA of innocent people on a criminal register amounted to discrimination and a breach of the 'right to respect for private life' safeguarded by the Human Rights Convention.
The result is a victory for two Britons who have been fighting to change the law after police insisted on retaining their DNA records.
Michael Marper, 45, was arrested in March 2001 and charged with harassing his partner, but the case was dropped three months later after the two were reconciled. He had no previous convictions.
In a separate case, a 19-year-old named in court only as 'S' was arrested and charged with attempted robbery in January 2001 when he was 12, but he was cleared five months later.
The men, both from Sheffield, asked that their fingerprints, DNA samples and profiles be destroyed.
South Yorkshire Police refused, saying the details would be retained 'to aid criminal investigation'.
The men's claims were later thrown out by the House of Lords, which ruled that keeping the information was not illegal under the Criminal Justice and Police Act, and did not breach human rights.
But earlier this year, when the cases came before the Human Rights Court, lawyers for the two men argued
It violated their 'right to respect for private life' and 'prohibition of discrimination' safeguarded by the Human Rights Convention, to which the UK is a signatory.
The ruling could force the Government to remove the DNA details of hundreds of thousands of Britons from its database.
Currently a total of about 4.5 million names are held on the list for England, Wales and Northern Ireland.
Scotland already destroys DNA samples taken during criminal investigations from people who are not charged or who are later acquitted of alleged offences.
Home Secretary Jacqui Smith said she was 'disappointed' with the ruling.
'DNA and fingerprinting is vital to the fight against crime, providing the police with more than 3,500 matches a month, and I am disappointed by the European Court of Human Rights' decision,' Ms Smith said.
'The Government mounted a robust defence before the Court and I strongly believe DNA and fingerprints play an invaluable role in fighting crime and bringing people to justice.
'The existing law will remain in place while we carefully consider the judgment.'
The judgment ruled unanimously that there had been a violation of the Human Rights Convention's Article 8 - the right to respect for private and family life.
It stated: 'The protection afforded by Article 8 would be unacceptably weakened if the use of modern scientific techniques in the criminal justice system were allowed at any cost and without carefully balancing the potential benefits of the extensive use of such techniques against important private-life interests.'
The judges said any country claiming a 'pioneer' role in the development of new technologies bore special responsibility for striking the right balance.
And they attacked the 'blanket and indiscriminate nature' of the power of retention of data in England and Wales.
'In particular, the data in question could be retained irrespective of the nature of gravity of the offence for which an individual was originally suspected, or of the age of the suspected offender; the retention was not time-limited; and there existed only limited possibilities for an acquitted individual to have the data removed from the nationwide database or to have the materials destroyed,' they said.
The judgment went on: 'The court expressed a particular concern at the risk of stigmatisation stemming from the fact that persons in the position of the applicants (Marper and 'S'), who had not been convicted of any offence and were entitled to the presumption of innocence, were treated in the same way as convicted persons.'
The retention of private data could not be equated with the 'voicing of suspicions', acknowledged the judges.
They added: 'Nonetheless, their perception that they were not being treated as innocent was heightened by the fact that their data was retained indefinitely in the same way as the data of convicted persons, while the data of those who had never been suspected of an offence was required to be destroyed.'
Keeping the data of unconvicted people would be especially harmful in the case of minors such as 'S', bearing in mind the importance of their development and integration in society.
The ruling said: 'Particular attention has to be paid to the protection of juveniles from any detriment that could result from the retention by the authorities of their private data following acquittals of a criminal offence.'
The judgment concluded: 'The court found that the blanket and indiscriminate nature of the powers of retention of the fingerprints, cellular samples and DNA profiles of persons suspected but not convicted of any offence failed to strike the right balance between the competing public and private interests and that (the UK) had overstepped any acceptable margin of appreciation in this regard.
'Accordingly, the retention in question constituted a disproportionate interference with the applicants' right to respect for private life and could not be regarded as necessary in a democratic society'.
Today's judgment made clear that retaining fingerprint information about unconvicted people was in itself enough to constitute an interference with respect for private life.
But the retention of cellular samples and DNA profiles had an even more important impact on privacy, because of the information both contained.
Cellular samples contain much sensitive information about an individual, including about health, as well as a unique genetic code of great relevance to the individual and his or her relatives.
And on DNA the judges remarked: 'The possibility created by DNA profiles for drawing inferences about ethnic origin made their retention all the more sensitive and susceptible of affecting the right to private life.'
The judge awarded the two men a total of £36,500 in costs, but no cash damages - saying their victory, 'with the consequences that this would bring for the future', could be regarded as sufficient compensation.
The judgment said it would now be for the UK, under the supervision of a Committee of Ministers of the Council of Europe, which upholds the Human Rights Convention, 'to implement appropriate general and/or individual measures to fulfill its obligations to respect for their private life'.
Human rights watchdog Liberty, which supported the two Sheffield men in their legal action in the UK courts, said the judgment was sensible.
Liberty director Shami Chakrabarti commented: 'This is one of the most strongly-worded judgments that Liberty has ever seen from the Court of Human Rights.
'That court has used human rights principles and common sense to deliver the privacy protection of innocent people that the British Government has shamefully failed to deliver.'