A test case "fair play" ruling could force the Government to pay out millions of pounds to thousands of jobseekers denied benefits under its flagship back-to-work schemes.
The Department for Work and Pensions (DWP) brought in emergency retrospective legislation to stop payouts after regulations governing the schemes were found to be legally flawed in an earlier decision by top judges.
But the High Court declared today that the emergency legislation was itself flawed and violated Article 6 (1) of the European Convention on Human Rights, which protects the right to a fair trial.
The back-to-work schemes have been condemned by critics as ''slave labour'' because they involve work without pay - but are seen by supporters as a good way of getting the unemployed back into the world of work.
Jobseeker's allowance benefits have been withheld from those deemed to have failed to co-operate.
Mrs Justice Lang, sitting in London, rejected Government spokesman Lord Freud's assertion that repayment of benefits withheld unlawfully would be "an undeserved windfall" for claimants.
She declared: "They are merely receiving their legal entitlement."
The judge held: "Parliament's undoubted power to legislate to overrule the effect of court judgments generally ought not to take the form of retrospective legislation designed to favour the Executive in ongoing litigation in the courts brought against it by one of its citizens, unless there are compelling reasons to do so.
"Otherwise it is likely to offend a citizen's sense of fair play."
The judge said she "readily understood" that a Government faced with the prospect of substantial repayments "would consider it in the public interest not to pay them."
This was particularly so as the DWP "aims to reduce its benefits bill as part of the overall deficit reduction programme".
However financial loss alone was not a sufficiently compelling reason to justify retrospective legislation when balanced against the right to a fair trial.
A DWP spokesman said there would be an appeal, and payouts would remain on hold until it was heard.
Today's ruling was a second legal victory for university graduate Cait Reilly, 24, from Birmingham, who challenged having to work for free at a local Poundland discount store.
Ms Reilly and 40-year-old unemployed HGV driver Jamieson Wilson, from Nottingham, won the original ruling that regulations governing the back-to-work schemes were flawed.
Mr Wilson objected to doing unpaid work cleaning furniture and as a result was stripped of his jobseeker's allowance for six months.
Ms Reilly was joined in the battle against the subsequent emergency legislation by another jobseeker, Daniel Hewstone, who has received jobseeker's benefits since 2008.
The court was told Mr Hewstone stopped attending the DWP's Work Programme because he could not afford to wait for his travel expenses to be reimbursed and felt that the menial work offered did not enhance his skills or improve his prospect of finding long-term work.
Public Interest Lawyers solicitor Phil Shiner, who represented the victorious jobseekers, called on the DWP "to ensure that the £130 million of benefits unlawfully withheld from the poorest section of our society is now repaid."
Mr Shiner said: "This case is another massive blow to this Government's flawed and tawdry attempts to make poor people on benefits work for companies, who already make massive profits, for free.
"Last year the Supreme Court told Iain Duncan Smith and the coalition Government that the scheme was unlawful."
The attempt to introduce retrospective legislation, after the DWP had lost in the Court of Appeal, was "a further disgraceful example of how far this Government is prepared to go to flout our constitution and the rule of law".
The DWP spokesman said: "We're pleased the court recognised that if claimants do not play by the rules and meet their conditions to do all they can to look for work and get a job, we can stop their benefits. That is only right.
"However, we disagree with the judgment on the legislation and are disappointed. It was discussed, voted on and passed by Parliament.
"While this applies to only a minority of past cases and does not affect the day to day business of our Jobcentres, we think this is an important point and will appeal."
In her ruling, Mrs Justice Lang said jobseekers Ms Reilly and Mr Hewstone were both in receipt of jobseeker's allowance - "a subsistence level benefit payable to persons actively seeking employment".
At the time of their claiming, it was £56.80 a week for those aged 16-24 and £71.70 for those aged 25 and over.
Under the Jobseekers Allowance (Employment, Skills and Enterprise Scheme) Regulations 2011 claimants were required to take part in a variety of unpaid "work for your benefit" schemes.
Both the Court of Appeal and Supreme Court ruled the 2011 regulations unlawful and unfair because insufficient information was provided to claimants to be able to make meaningful representations before they were required to take part in schemes.
The regulations had also failed to give effect to Parliament's intention that the regulations would include "prescribed descriptions of schemes" so that it would not be open to the DWP "to introduce such schemes from time to time, as it thought fit."
On February 12 2013 - the day the appeal judges gave their ruling - the DWP immediately made the Jobseekers Allowance (Schemes for Assisting Persons to Obtain Employment) Regulations 2013.
The 2013 regulations were intended to "correct the flaws" the appeal judges had identified in the 2011 regulations and to apply retrospectively from the date they were made.
A month later the Government introduced the Jobseekers (Back to Work Schemes) Act 2013 to "retrospectively validate" the 2011 regulations and the sanctions, including loss of benefits, imposed under them .
It is the 2013 Act the court has declared incompatible with the European Convention of Human Rights. The judge stressed her ruling only applied to the "minority of claimants" who have pursued their claims for lost benefits before courts and tribunals.
The judge said that the total figure of repayments of benefits wrongly withheld under the flawed regulations was put at "up to £130 million", but that was an estimate and included sanctions imposed and decisions stockpiled under parallel 2011 regulations - the Jobseekers Allowance (Mandatory Work Activity Scheme) Regulations.