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.

'So heinous'

Analysis

By Clive ColemanLegal correspondent, BBC News

Today's judgement is pretty stark. On the critical issue of whether whole-life terms were "reducible" and offered prisoners some "hope" and "possibility" of release in exceptional circumstances, the Court of Appeal flatly disagreed with the Grand Chamber of the ECHR.

The nub of the argument concerned the only current means under domestic law for a whole-life term to be reduced. It can only happen if the justice secretary is satisfied that exceptional circumstances exist which can justify a prisoner's release on compassionate grounds.

Existing guidance specifies that the prisoner should be suffering from a terminal illness and that death is likely to occur very shortly. The ECHR thought it was unclear whether the justice secretary would apply this restrictive policy. It didn't regard release purely to die in a hospice or at home as sufficient to represent a "prospect of release", and so represented a breach of Article 3 of the European Convention on Human Rights.

The Court of Appeal disagreed. It explained that the justice secretary cannot be restrictive, must take into account all exceptional circumstances relevant to the release of the prisoner on compassionate grounds, and must interpret "compassionate grounds" in accordance with human rights law. The court concluded that meant that the law in England and Wales was clear and did offer both "hope" and the "possibility" of release.

The UK courts have disagreed with Strasbourg before, but rarely in such a clear and unvarnished way. Under the Human Rights Act domestic courts are bound to "take into account" ECHR rulings. Some believe that means, ultimately, "must follow". Today's ruling perhaps marks the start of a far more robust dialogue between the ECHR and our domestic courts.

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.

What is a whole-life tariff?

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

However, prisoners can have their sentence reduced on appeal

The sentence is reserved for offenders judged to be the most dangerous to society

53 people are currently serving whole-life tariffs

These include the Yorkshire Ripper Peter Sutcliffe and Moors Murderer Ian Brady

Serial killer Rosemary West is the only woman currently serving a whole-life sentence

The most recent murderers to receive the sentence are Mark Bridger, who killed five-year-old April Jones, and Dale Cregan, who murdered two police officers

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.