Image caption David Oakes tried to kill himself after he shot dead his partner and their daughter.

The Court of Appeal has upheld the principle of whole life sentences for the most dangerous of offenders, saying it does not breach human rights.

The Lord Chief Justice and four judges said jail without the possibility of release should be "reserved for the few exceptionally serious offences".

He said judges must be convinced those sentenced to whole life need to be held forever for punishment and retribution.

It comes a week before an appeal by Jeremy Bamber and two murderers.

Bamber and two others will be seeking to overturn their whole life tariffs at the Grand Chamber of the European Court of Human Rights.

The power to imprison someone forever is reserved for offenders judged to be the most dangerous to society and currently applies to 46 people in jail. Other life term prisoners can be released on licence if they can prove they are no longer a risk to society.

The judgement effectively sends a signal to the Strasbourg judges that the courts in England and Wales are content that whole life tariffs are justified and that the power to jail someone forever should not be overturned.

In their ruling the Court of Appeal judges upheld the sentence of whole life imprisonment given to one killer, David Oakes. He tortured and shot his partner and their daughter in Essex, before attempting to turn the gun on himself.

But the court replaced the whole life tariff for three other serious offenders.

Whole life tariff appeals Michael Roberts: The 'Bermondsey rapist' whose attacks were between 1988 and 1990 and whose victims included an 83-year-old woman. Whole life tariff changed to minimum of 25 years.

The 'Bermondsey rapist' whose attacks were between 1988 and 1990 and whose victims included an 83-year-old woman. Whole life tariff changed to minimum of 25 years. Danilo Restivo: Murdered his Bournemouth neighbour Heather Barnett in 2002 and Elisa Claps, 16, in Potenza, Italy, in 1993. Whole life tariff changed to minimum of 40 years.

Murdered his Bournemouth neighbour Heather Barnett in 2002 and Elisa Claps, 16, in Potenza, Italy, in 1993. Whole life tariff changed to minimum of 40 years. David Oakes: Shot ex-partner Christine Chambers, 38, and two-year-old daughter Shania at their home in Braintree, Essex, in June 2011. Whole life tariff upheld.

Shot ex-partner Christine Chambers, 38, and two-year-old daughter Shania at their home in Braintree, Essex, in June 2011. Whole life tariff upheld. David Martin Simmons: Jailed for life for rape and false imprisonment. Whole life tariff changed to minimum of 10 years. Criminals in life sentence appeal

Danilo Restivo, who mutilated his neighbour in Bournemouth and was found guilty of another murder in Italy, was told he would receive a 40-year minimum term.

Two other rapists were given minimum terms to replace their whole life tariffs.

The Lord Chief Justice, Lord Judge, said it was highly unlikely any of the men could ever be released because of the danger they posed to society.

Lord Judge said that Parliament had clearly legislated to allow judges to hand down whole life sentences without the possibility of release - and that the European Court had already accepted it could not intervene.

"It is open to the individual state, to make statutory provision for the imposition of a whole life minimum term, and in an appropriate case, as a matter of judicial discretion, for the court to make such an order," he said.

"The result is that the whole life order, the product of primary legislation, is reserved for the few exceptionally serious offences in which, after reflecting on all the features of aggravation and mitigation, the judge is satisfied that the element of just punishment and retribution requires the imposition of a whole life order.

"If that conclusion is justified, the whole life order is appropriate: but only then. It is not a mandatory or automatic or minimum sentence."

The judges also dismissed an appeal against a minimum 30 year term brought by Kiaran Stapleton, convicted of the murder of Indian student Anuj Bidve in Salford. His appeal was unrelated to the whole life tariff cases.

The Court of Appeal's decision comes the week before the European Court of Human Rights deals with similar appeals.

Three men serving whole-life tariffs for murder will have their cases heard by the Grand Chamber, the highest level of the Strasbourg court.

The men include Jeremy Bamber, convicted of shooting his adoptive parents, sister and her two children in 1985 in Essex.