The 42 days that Robert Napier spent on remand at Barlinnie may prove to be the most expensive in Scottish legal history.

Despite successive international and domestic warnings in the 1990s that stated slopping out and prison conditions across Scotland were inhumane, little was done to improve the state of the country's jails.

Former justice minister Jim Wallace even diverted some £13m away from prison development into other areas of the justice department in 1999 - money which, later investigations proved, could have at least stemmed the tide of later litigation.

The financial implications of such complacency began under the previous Scottish Executive, when a single prisoner took them on and won.

The court ruled that Mr Napier had been forced to suffer inhumane and degrading conditions, partly as a result of the fact he had to slop out in Barlinnie. In 2004, he was awarded £2450 for the effect the prison conditions had on his health. Hundreds of prisoners came forward as a result.

As the numbers seeking compensation swelled and the courts became inundated with cases, the executive decided to cut its losses, believing it was protected, in part at least, by the one-year time bar that restricted claims under the European Convention on Human Rights (ECHR).

Forced to face the reality of the situation, a settlement was reached with 190 prisoners last year. It cost less than £500,000 in claims.

However, in October, the Law Lords' ruling tipped this plan on its head. It raised the possibility that people could sue Scottish ministers for alleged human rights breaches that occurred at any time from 1999 onwards, when the ECHR was incorporated into the Scotland Act.

A further £3.7m is now being paid out in settlement. In addition, hundreds more cases, those where the conditions were not defined as sharing a cell and slopping out and those who have refused the offer, are still going through the courts.

Mr Napier won only a small level of compensation because he spent just six weeks in prison. Others, who have spent years slopping out, still hope to get higher remuneration as a result of October's ruling.

Prison managers have had to set aside tens of millions for possible claims and admitted last year there was a £76m contingency pot for just such a scenario.

It is so serious that Kenny MacAskill, the Justice Secretary, sought an urgent meeting with Lord Chancellor Jack Straw, warning of "serious concerns" over the implications of the ruling.

Criminals such as Shaun Loughlin, who spent five months in Barlinnie for theft, fraud, and possession of drugs, and has now been offered £4000 for being locked up in inhumane conditions, traditionally hold a smaller-than-average proportion of the country's sympathy. Rightly so, many would argue. But they have the same human rights. Their punishment is to lose their liberty, not to face degrading conditions once locked up.

"We should never have been in this situation," says Tony Kelly, lawyer to the majority of the prisoners who have taken such cases. "It was entirely avoidable. If the money had been spent appropriately to remove slopping out, they would not be in this position now.

"We cannot say that a line has been placed under this. Every time they have tried to draw a line they have had to push it further back."

Slopping out was eradicated in England and Wales by 1995, and ministers said they would remove the need for it in Scotland by 1999. However, until recently, it was still common practice in parts of Barlinnie, Perth, Polmont, and Edinburgh prison.

Last night Mr MacAskill, said: "This is a problem we inherited that we just have to get on and deal with. The key now is to minimise the cost to the taxpayer as much as possible."



If there was no case to answer I wouldn't have got legal aid'

Shaun Loughlin believes criminals should be punished for their wrongdoings. He says those behind bars should not dwell in palatial comfort but neither does he think inmates should be forced to live in squalor. Most people, he contends, would agree.

His view is perhaps surprising because it was formed during a five-month stint in Barlinnie. He is one of the 927 former and current inmates who have been offered £4000 (£2100 for himself and £1900 for his lawyer) by the Scottish Government for being locked up in inhumane conditions.

"In some ways I don't think prisoners deserve this," he said. "But for me it was about a specific medical condition. I don't think prisoners should expect plush conditions but this was about medical failings. It seems quite sleekit, but if there was no case to answer I would not have got legal aid to fight my case in the first place.

"The public perception is to question whether any prisoner should get compensation. People go to prison for a reason. I went there because I broke the law and I was wrong to do that, but equally I think everyone deserves a second chance."

In 2002, Mr Loughlin spent five months in Barlinnie for theft, fraud and possession of drugs. Forced to share a cell and slop out for the duration, he suffered physically and mentally.

Before he was imprisoned, he had been diagnosed with Obsessive Compulsive Disorder (OCD) and a fear of people. He spent 18 months unable to leave the house without at least one person to look after him. Once inside, his condition worsened and he claims he was unable to get his prescribed medication.

"My first thought was of suicide," he says. "I don't think anyone goes to jail without contemplating suicide in the first few days. When I tried to explain my medical condition and asked them to to move me away from the other prisoners and get hold of my doctor's notes they just said it's not f****** Butlins'."

Mr Loughlin has stayed out of trouble since he was released six years ago. He moved away from Glasgow, got a job and started a new life.

"My mum and dad were heavy drinkers and they both died from that when I was 15," he says. "That's probably why I got into drinking and taking valium, but it's no excuse. I have to accept it's my fault."