In December, the ECHR had ordered Germany to pay €50,000 in damages to a prisoner held in preventive detention for nearly 20 years, but the ECHR rejected Germany's referral request lodged in March.
"The Court's Chamber judgment of 17 December 2009 has thereby become final," an ECHR statement said on Tuesday.
The original case concerned a 52-year-old prisoner, known as M, with at least seven convictions for offences including attempted murder, robbery, aggravated robbery, serious assaults and blackmail.
He has also wounded several fellow detainees, in particular a disabled man, and tried to rob and murder a woman accompanying him on a day trip out of his psychiatric hospital.
Experts had judged that he had psychological problems but was still morally responsible for his actions.
Under German law at the time of his conviction, preventive detention was limited to 10 years, which would have meant he was released in 2001.
But an amendment passed in 1998 allowed the detention to be extended indefinitely if it was judged necessary for public safety, and this was applied retroactively to M.
The Strasbourg court ruled that the retroactive detention of the prisoner was not justified, because "there was no sufficient causal connection between his conviction and his continued deprivation of liberty."
"The applicant's continued detention had not been justified by the risk that he could commit further serious offences if released," the court said, judging that "these potential offences were not sufficiently concrete and specific."