British courts do have the right to impose whole-life tariffs on prisoners who are jailed for life, the European Court of Human Rights has ruled.
The court had said in 2013 that whole-life sentences breached human rights because it was not clear if there was the chance of a review of such cases.
Judges have now said this is not the case with murderer Arthur Hutchinson, who challenged his whole-life sentence.
The UK was considered to be in line with human rights laws, they added.
The European court had previously said there had to be the possibility of a review at some stage and that current laws allowing for release in exceptional circumstances were unclear.
The Court of Appeal in the UK then said in 2014 that the law in England and Wales "is clear as to 'possible exceptional release of whole-life prisoners'".
It said the justice secretary had the power to release a prisoner on licence if they were satisfied exceptional circumstances existed that justified it on compassionate grounds.
The Strasbourg-based court ruled that in Hutchinson's case there had been no violation of Article 3 of the European Convention on Human Rights, which relates to inhuman and degrading treatment.
The judges said in a written ruling: "In the circumstances of this case where, following the Grand Chamber's judgment in which it expressed doubts about the clarity of domestic law, the national court has specifically addressed those doubts and set out an unequivocal statement of the legal position, the court must accept the national court's interpretation of domestic law."
By Clive Coleman, legal affairs correspondent, BBC News
The ruling is perhaps more significant politically than it is legally.
In 2013, the Grand Chamber of the European Court of Human Rights ruled that whole-life sentences passed on the most heinous murderers were incompatible with human rights and amounted to inhuman and degrading treatment. The reason was the lack of a proper review and so the lack of hope, however remote, of eventual release.
That caused political ructions. It was cited by the Conservatives in proposals published last year to scrap the Human Rights Act in favour of a British Bill of Rights and to ensure that Parliament was not bound by Strasbourg rulings. The whole-life sentence ruling, along with that on prisoner votes, were seen by many as examples of expansionist European judges straying beyond their original human rights brief.
However, last year the Court of Appeal clarified the justice secretary's power to review whole life sentences in "exceptional circumstances".
It had previously been used to review cases and release prisoners with weeks to live on compassionate grounds, but the Court of Appeal said it was broader and was compatible with human rights.
Strasbourg agreed with that. An example of a sensible dialogue between national courts and the ECHR? If so, it takes away the some of the justification for renegotiating the UK's relationship with the European Court of Human Rights.
Hartlepool-born Hutchinson was jailed for stabbing Basil and Avril Laitner to death after breaking into their Sheffield home on the night of their daughter's wedding then killing one of their sons in 1983.
The judge in his 1984 trial at Sheffield Crown Court said he should serve 18 years but Home Secretary Leon Brittan later ruled he should face a whole-life tariff.
Hutchinson's domestic appeal against whole-life tariffs was rejected by the Court of Appeal six years ago.
The initial challenge against whole-life terms was brought by Jeremy Bamber, who shot dead five members of his family in 1985, and two other killers.
Offenders who receive a whole-life tariff cannot be released other than at the discretion of the justice secretary on compassionate grounds, for example if they are terminally ill or seriously incapacitated.
They are not eligible for a parole review or release but can have their sentence reduced on appeal. The sentence is reserved for offenders judged to be the most dangerous to society.
Notorious current whole-life prisoners include police killer Dale Cregan, Mark Bridger who murdered five-year-old April Jones, and Moors murderer Ian Brady.