The High Court has ruled emergency laws underpinning a government back-to-work scheme are "incompatible" with the European Convention on Human Rights.
The ruling stems from a case brought by Cait Reilly in 2012, who said being forced to work for free at a Poundland store breached her human rights.
The government brought in new rules in 2013 allowing unpaid work schemes to continue pending further legal appeals.
Ministers said they were "disappointed" by the ruling and would appeal.
Miss Reilly, a 24-year old university graduate, challenged the legality of an unpaid work placement she undertook in 2011.
She said that she was told that if she did not agree to take part in the scheme, which she said involved stacking shelves, she would lose her Jobseeker's Allowance.
The government was forced to pass emergency legislation amending the scheme last year after Court of Appeal ruled that the regulations underpinning it did not comply with existing laws giving the Department for Work and Pensions the power to introduce the programme.
Read more on the BBC website