The Court of Appeal has upheld judges' right to jail the most serious offenders in England and Wales for the rest of their lives.
The court increased a 40-year tariff to a whole-life tariff for murderer Ian McLoughlin, whose trial judge had said he was unable to pass such a sentence.
It also dismissed an appeal by murderer Lee Newell that his whole-life order had been "manifestly excessive".
In July, the European court said that while it accepted whole life orders could be justified, there should nevertheless be some way of having imprisonment reviewed after 25 years.
Tuesday's Court of Appeal ruling was welcomed by the attorney general, the justice secretary and the shadow justice secretary.
Sentencing in a number of high-profile criminal cases - including the terms to be handed out to soldier Lee Rigby's murderers - had been put on hold pending the judgement.
Under current law, whole-life tariffs can be given for "exceptionally" serious offences. They prevent offenders from ever being eligible for a parole review or release, unless at the discretion of the justice secretary.
In July the ECHR ruled whole-life sentences had to have the possibility of release and, to be compatible with the European Convention on Human Rights, there should be some way of having a sentence reviewed after 25 years.
That ruling followed a successful appeal by convicted murderers Jeremy Bamber, Douglas Vinter and Peter Moore.
In the latest Court of Appeal ruling, the panel of five judges found that the Strasbourg court had been wrong when it reached a conclusion that the law of England and Wales did not clearly provide the possibility that a whole-life prison term could ever be reduced.
They said a power of review arose if there were "exceptional circumstances" whereby the offender could appeal to the secretary of state.
"In our judgement the law of England and Wales therefore does provide to an offender 'hope' or the 'possibility' of release in exceptional circumstances which render the just punishment originally imposed no longer justifiable," Lord Chief Justice Lord Thomas said.
Lord Thomas said some crimes were "so heinous" that Parliament was entitled to allow whole-life orders "entirely compatibly" with the European Convention on Human Rights.
"Judges should therefore continue as they have done to impose whole-life orders in those rare and exceptional cases," he said.
Newell's lawyers had challenged his whole-life order for murdering child killer Subhan Anwar while already in prison for another killing. Lord Thomas dismissed the appeal, saying the murder had been "premeditated and involved the use of an improvised weapon".
Ian McLoughlin killed Graham Buck, 66, in Hertfordshire in 2012, while on prison day-release from another murder sentence. Mr Buck had gone to the aid of a neighbour who was being burgled.
Ruling on the McLoughlin case, the Court of Appeal said the sentencing judge had been "in error" in thinking he did not have the power to make a whole-life order in the wake of the Strasbourg court's ruling.
Lord Thomas said the seriousness of the case - which had been referred to the Court of Appeal by Attorney General Dominic Grieve - was "exceptionally high" and 40 years was unduly lenient.
Reacting to Tuesday's ruling, Mr Grieve said he was "pleased".
He said he had not thought the Strasbourg court said anything "which prevented our courts from handing down whole-life terms in the most serious cases".
"Today's judgement gives the clarity our judges need when they are considering sentencing cases like this in the future," he said.
Justice Secretary Chris Grayling also welcomed the decision as upholding the law that the UK Parliament had passed.
Shadow justice secretary Sadiq Khan said: "Judges should be able to lock up for life those guilty of the most horrible crimes and it was a Labour government that gave them this power.
"We now need the government to make a considered response to the Strasbourg judgement and Labour is willing to work with ministers to get the right result."
However, Simon Creighton, solicitor for convicted murderer Douglas Vinter, called the decision "troubling" and said it was "fundamental" that prison sentences had "some form of rehabilitation and redemption" built in. His client was "not expecting" to be released but wanted "something to work towards", he added.
There are currently 53 prisoners on whole-life terms in England and Wales, including Moors Murderer Ian Brady and serial killer Rosemary West.
In December the judge in the Lee Rigby murder trial said he would wait for the decision by the Court of Appeal before passing sentence on Michael Adebolajo and Michael Adebowale, who were convicted in December of killing Fusilier Rigby in Woolwich, south-east London, in May last year.
The killers will be sentenced at the Old Bailey on 26 February at 14:00 GMT, a Judicial Office spokeswoman has confirmed.