Some Scottish prisoners will receive an out-of-court settlement for having to slop out, a court has heard.
Hundreds of prisoners are seeking compensation for having to slop out
Hundreds of damages claims are planned after ministers lost a case brought by armed robber Robert Napier, who received £2,450 in compensation.
The Court of Session heard that inmates who could back their claim with medical evidence would receive a pay-out.
But ministers' efforts to save time and money by picking others as test cases failed to get off the ground.
Napier was awarded compensation last April after complaining that he had suffered an outbreak of eczema because he had to slop out at Barlinnie Prison in Glasgow.
Five advocates appeared at the Court of Session on Wednesday for a procedural hearing on behalf of five inmates who are seeking between £5,000 and £20,000 after being forced to use a chemical toilet in their cells at Peterhead Prison.
Lord Penrose heard that 74 actions had been brought by prisoners or ex-inmates at Peterhead, Saughton and Barlinnie.
Another 322 cases have been started in sheriff courts across Scotland, and lawyers are preparing hundreds of other actions which have yet to come to court.
Gerry Moynihan QC, senior counsel for the Scottish ministers, said his client had decided that cases similar to Mr Napier's would be settled out of court.
They will negotiate "a settlement of compensation" to prisoners if doctors back their claims that medical or psychological problems had been caused, or made worse, by slopping out.
Mr Moynihan asked for more time for discussion with prisoners' lawyers over actions which ministers were determined to contest.
"What the Scottish ministers are proposing is that attempts be made to identify a sample of cases from among the 74 that would serve as test cases," he said.
However, Simon Collins, appearing for Peterhead inmate Graham Gordon, said these discussions could not take place before ministers had outlined their case in the individual actions.
The cases are being heard at the Court of Session
He said the way forward proposed by ministers was a "gross over-simplification" which took no account of different ages, states of health, sex, or length of sentence.
"How does that deal with the case of a prisoner 75 years old in Peterhead who has slopped out for five years compared with a prisoner of 20 in Saughton who has slopped out for one single night?" he asked.
"These cases are fact sensitive."
The advocates appearing for the four other prisoners agreed with Mr Collins.
Lord Penrose ordered Scottish ministers to say within 28 days whether or not they agreed with the facts stated by the five prisoners about their conditions.
He gave them two months to state their case on more complicated matters or legal issues which might be in dispute.