The government has been defeated in the Lords in a vote on its plans for a £26,000-a-year household benefit cap.
Lib Dem, Labour and crossbench peers backed a bishop's amendment by 252 to 237 that child benefit should not be included in the cap.
Critics argued that imposing the same cap on all families, regardless of size, would penalise children.
The government said it was "very disappointed" and the vote "clearly flies in the face of public opinion".
Earlier the government defeated another amendment proposed by Labour to exempt people considered at risk of homelessness from the cap.
The annual cap would come into force for working age families in England, Scotland and Wales from 2013.
The government was defeated three times on votes on other parts of its flagship Welfare Reform Bill two weeks ago.
But Work and Pensions Secretary Iain Duncan Smith has said any defeats will be overturned when the legislation returns to the Commons.
The amendment on child benefit was put down by Bishop of Ripon and Leeds, the Rt Rev John Packer.
He said child benefit was "a universal benefit" and it was "wrong to see it as being a welfare benefit".
"It's a benefit which is there for all children, for the bringing up of all children and to say that the only people who cannot have child benefit are those whose welfare benefits have been capped seems to me to be a quite extraordinary argument."
He said the cap "failed to differentiate between households with children and those without" and child benefit was "the most appropriate way to right this unfairness".
But Mr Duncan Smith said excluding child benefit would make the cap "pointless" - as it would raise the amount families could receive to an average of about £50,000 a year.
He said he wanted to be "fair" to taxpayers on low wages, who were supporting families in homes they themselves could not afford.
Enver Solomon, policy director at The Children's Society, said it was "delighted" with the results of the vote, arguing it was "totally unfair that a small family with a household income of £80,000 a year receive it, yet a large family with a benefit income of £26,000 are excluded".
"The government must not ignore the fact that the Lords have spoken out to defend the plight of some of the country's most disadvantaged children," he said.
The Centre for Social Justice, a think tank set up by Mr Duncan Smith in 2004, said the result was "peculiarly out of line with public opinion".
Executive director Gavin Poole said: "Opponents in the House of Lords have missed a crucial opportunity to support the benefit cap, a policy which would bring about positive welfare reform."
Labour said its peers would support the bishop's amendment after their own was rejected by 250 votes to 222.
The Labour amendment would have exempted people who would be considered "threatened with homelessness" under the cap - and obliged to be rehoused by their local council.
In the Commons, Mr Duncan Smith accused the Opposition of saying they were in favour of a cap on benefits - while tabling a "wrecking amendment".
"They can't weasel their way out of it and say they are in favour on the one hand and against on the other," he said.
Labour says it supports the cap, but as it stands it could end up costing the taxpayer more if 20,000 families have to be rehoused.
The cap would be £500 a week - equivalent to the average wage earned by working households after tax - for families and £350 a week for single adults without children.
On Monday the government revised up its estimate of how many households would be affected - from 50,000 to 67,000, although the amount of money they would lose was revised down from £93-a-week to £83-a-week. More than half of those affected live in London.
There have been suggestions that some "transitional arrangements" could be introduced for families affected by the cap.
Mr Duncan Smith said most of those affected were people who had never worked - and had no incentive to do so because they were living in expensive properties which they would have to move out of if they lost their housing benefit entitlement.
He has rejected suggestions children could be pushed into poverty by the cap or that some families would be left homeless.
Former Lib Dem leader Lord Ashdown said he would vote against the plans unless there were measures to cushion the impact on those affected.
And former Lib Dem chief whip Lord Kirkwood argued that a cap allowed ministers arbitrarily to "over-ride" people's rightful benefit entitlements and insisted: "I don't think it's safe to grant ministers these powers."
The changes would affect England, Wales and Scotland. Northern Ireland has its own social security legislation, but it is expected that what is approved at Westminster would be introduced there too.