The Court of Appeal has overturned a High Court decision that the detention of convicted murderer Daniel McDonnell in solitary confinement for a year breaches his rights to bodily and psychological integrity.

McDonnell, described by his lawyers as the most vulnerable prisoner within the system, is serving a life sentence for the murder of 16-year-old Melanie McCarthy McNamara in a drive by shooting in Tallaght in February 2012.

In his High Court judgment on McDonnell’s challenge to the conditions of his detention, Mr Justice Brian Cregan found the regime McDonnell was subject to at Wheatfield Prison for 12 months breached his rights to bodily and psychological integrity.

The 22 to 23 hour per day lock up was unlawful, “to all intents and purposes solitary confinement” and neither necessary nor proportionate to the perceived threat to McDonnell’s person, the judge found.

He later granted injunctions directing the prison authorities to allow McDonnell more time out of his cell and provide him with more social interaction.

The Wheatfield prison governor appealed all the High Court’s decisions, arguing McDonnell has been kept apart from the rest of the prison population for his own safety.

McDonnell, from Brookview Lawns, Tallaght, was found guilty in January 2014 by a jury at the Central Criminal Court of murdering Ms McCarthy McNamara. He had denied the charge.

In his High Court proceedings, he claimed he only had one hour outside his cell to do chores and exercise and had been refused permission to mix with other prisoners. He spends his time in his single cell and claimed he was finding it difficult to cope and his health has suffered.

In its judgment the Court of Appeal, comprising the President of the Court, Mr Justice Sean Ryan, Mr Justice George Birmingham and Mr Justice Gerard Hogan, found the High Court erred in making the disputed orders and declarations.

It is for the prison authorities to decide what measures are necessary for the safety of prisoners, the court said.