The government has been defeated in the House of Lords after peers voted to accept 3,000 unaccompanied child refugees into the UK from Europe.
An amendment to the Immigration Bill to let the children come to Britain was adopted by 306 votes to 204 - a majority of 102.
Labour's Lord Dubs, who came to the UK as a child refugee, said it would save children from exploitation and abuse.
But the government said the amendment would not target those most in need.
Home Office minister Lord Bates said the government was concentrating its efforts on helping Syrian refugees before they reach Europe and insisted no other country was doing more than the UK.
Campaigners, including charity Save the Children, have been calling for the government to accept 3,000 children from Europe into the UK, but ministers have warned that it could spur more refugees to risk "lethal" journeys.
Ministers may seek to overturn the defeat - the latest in a string of votes the government has lost in the Lords this Parliament - when the bill returns to the Commons.
Arguing for the UK to take in 3,000 unaccompanied child refugees, Lord Dubs said it would protect children from exploitation, people trafficking and abuse.
The peer - who arrived in the UK as a refugee on the Kindertransport which helped children escape from the Nazis during World War Two - said the UK needed to show the same compassion.
"I would like other children who are in a desperate situation to be offered safety in this country and be given the same opportunities that I had," he told peers.
His amendment - which would require ministers to allow the children to come to the UK as soon as possible after the bill became law - attracted cross-party support.
"We could do it in 1930s, why can't we do it now?" said crossbench peer Baroness Neuberger, while fellow crossbencher Lord Alton of Liverpool warned that refusing to help the children would leave a "lasting stain" on Britain's reputation.
"This is a small, but beautiful thing that we can do," added the Bishop of Chelmsford, the Rt Rev Stephen Cottrell.
Meanwhile, a call to exclude children above the age of 12 from the scheme came from former Conservative Chancellor Lord Lawson of Blaby.
Home Office minister Lord Bates said on behalf of the government: "We have a principled objection. That the people most at risk are in the region."
"I question whether it (the amendment) identifies, or provides help, for the right people. We believe we should not be doing anything that encourages one child to make that perilous journey," he added.
Lord Bates said 51% of the 1,000 Syrian refugees resettled in the UK - as part of the government's pledge to take in 20,000 by 2020 - had been children.
He also said there was a shortage of foster carers and that it was hard to place refugee families with local authorities.
But the government's argument was not supported by the majority of the House, which voted by a margin of 102 to accept the amendment.