The landmark court case in which a judge ruled that slopping out was a breach of a human rights in Scotland cost the executive more than half a million pounds to defend.

Cathy Jamieson, the justice minister, revealed yesterday that the bill for the court proceedings amounted to (pounds) 520,000 in a written answer to Linda Fabiani, the Nationalist MSP.

Once legal aid and the (pounds) 2450 compensation figure that Lord Bonomy awarded to the prisoner concerned are taken into account, the total cost could rise to more than (pounds) 1m, the SNP predicted.

Robert Napier won his court case against the Scottish ministers over the practice of slopping out in April this year. Lord Bonomy agreed with Napier that the outdated toilet practice breached his human rights.

The landmark ruling by a judge at the court of session could trigger a spate of similar claims from other prisoners.

Earlier this month the executive indicated it is to appeal against the court decision.

Today, the written answer from Cathy Jamieson revealed that the executive spent (pounds) 370,000 on lawyer's fees and court costs throughout the case.

A further (pounds) 98,000 was spent on expert witness reports and evidence, with (pounds) 52,000 going on additional costs. The figures do not include the cost of the services of the executive's own in-house solicitors.

Ms Fabiani said the cost to the executive was ''quite staggering''. She added: ''Equally worrying is the fact that they are going to appeal, bringing the prospect of another million pounds being spent.

''The judgment in the case was inevitable and the worry is that we could be faced with hundreds more cases against the executive.

''The question now must be: what is the Scottish Executive doing to avoid any more cases like this, and what are they doing to end the practice of slopping out in Scotland's jails?''

Cathy Jamieson said: ''Far from ignoring the problem of slopping out, we are making record levels of investment.

''The Scottish Prison Service is already investing (pounds) 1m a week to improve the prison estate, and earlier this month I announced that we are accelerating our reforms to improve prison conditions and create 200 new quick-build units on sites within the existing prison estate.

''But we inherited decades of neglect, and it will take time to deal with it.''