The Supreme Court has found that legislation stopping the payment of the State's contributory old age pension to prisoners is unconstitutional.
The case was taken by a 76-year-old man convicted of rape who claimed he did not have enough money to buy items in the prison tuck shop.
The court concluded the law was unconstitutional, but has postponed making final orders in the case until later this year, indicating there may be a legislative solution.
It also stressed the ruling does not mean prisoners have to get the full benefit of pensions or other welfare payments while in jail as there is already a scheme in place for compensation orders to be paid by installment to victims of crime.
Giving the court's unanimous judgment, Mr Justice John MacMenamin said while the State argued the law was intended to prevent unjust enrichment of prisoners, its true effect "can only be described as punitive, retributive, indiscriminate and disproportionate".
He said the measure was an additional punishment not imposed by a court and was therefore in breach of the separation of powers and Articles 34 and 38 of the Constitution.
Those provide justice shall be administered in courts and no person shall be tried on any criminal charge except in due course of law.
No such penalty is mandatorily imposed on prisoners with independent means, he noted.
The man was jailed for 12 years in 2011 after he was convicted on 14 counts of rape and 60 counts of sexual assault against a family member.
He had worked here and made PRSI contributions and, when he retired in 2005, got the State contributory pension. After his conviction in 2011, his pension payment was stopped.
Mr Justice MacMenamin noted the man's weekly prison allowance is €11.90, less than the normal weekly allowance of €18.90 due to his inability to engage in work activities in prison.
He claimed he had insufficient funds to buy items in the prison tuck shop or electrical goods and could not afford coffee although he had a kettle.
He said he relied on clothes provided by the prison service or St Vincent de Paul and also argued some other prisoners had access to non-State pensions.
Because this man is already sentenced, his position is more complex and the court will hear arguments in November over the appropriate remedy for him.
It will also address the costs issues later.