Single parents with a child under two have won a court challenge as they face "real misery" from the government's benefits cap.
A High Court judge said the cap was not intended to cover such households, had "no good purpose", and the failure to exempt them was discriminatory.
The government said it intended to appeal and there would be no change to the cap while this process was ongoing.
The cap limits the income households receive in certain benefits.
It stands at £23,000 for those in London and £20,000 a year outside London. Parents must work for at least 16 hours a week to avoid the cap.
The ruling was made in response to a judicial review brought by four lone parent families - including two who had been made homeless owing to domestic violence. Their solicitor said their benefits were, or were expected to be, cut as they were unable to work the 16 hours.
A judge in London ruled on Thursday that he was "satisfied that the claims must succeed" against the work and pensions secretary.
Mr Justice Collins said: "Whether or not the defendant accepts my judgment, the evidence shows that the cap is capable of real damage to individuals such as the claimants.
"They are not workshy but find it, because of the care difficulties, impossible to comply with the work requirement.
"Most lone parents with children under two are not the sort of households the cap was intended to cover and, since they will depend on DHP (Discretionary Housing Payments), they will remain benefit households.
"Real misery is being caused to no good purpose."
Solicitor Rebekah Carrier, who represented the claimants, said: "The benefit cap has had a catastrophic impact upon vulnerable lone parent families and children across the country.
"Single mothers like my clients have been forced into homelessness and reliance on food banks as a result of the benefit cap.
"Thousands of children have been forced into poverty, which has severe long-term effects on the health and well-being."
She said she thought around 17,000 families were affected.
A spokesman for the Department for Work and Pensions (DWP) said the government was "disappointed" with the decision and intended to appeal.
"Work is the best way to raise living standards, and many parents with young children are employed," he said.
"The benefit cap incentivises work, even if it's part-time, as anyone eligible for working tax credits or the equivalent under Universal Credit, is exempt. Even with the cap, lone parents can still receive benefits up to the equivalent salary of £25,000, or £29,000 in London and we have made Discretionary Housing Payments available to people who need extra help."
He said that households with young babies were among the groups that such housing payments were specifically aimed to assist.
The department said the benefits cap remained in place while the appeal process continued.
Alison Garnham, chief executive of Child Poverty Action Group, said: "We have the ridiculous situation where one part of the DWP has been telling lone parents with very young children that it understands they should not be expected to work, and another part of the DWP is punishing them severely for exactly the same thing."