An amendment proposed by Lord Dubs, who himself came to the UK as a child fleeing the Nazis on a kindertransport, was backed by 300 peers to 220, majority 80.
Following the vote, the peer called on MPs to “show what they’re made of” and back his amendment when the prime minister’s bill returns to the Commons on Wednesday.
Ministers had already been defeated by peers on giving EU citizens physical proof of their right to be in the UK, and on the power of the government over the relationship between Brussels and local courts.
But the government has vowed to overturn the defeats in the Commons, which it should do easily with its 80-seat majority.
Make sense of politics. Sign up to the Waugh Zone and get the political day in a nutshell.
Lord Dubs is seeking to restore the right of unaccompanied child refugees, who are in Europe having fled war or persecution in their home country, to be reunited with family members in the UK after Brexit after the PM attempted to delete earlier protections in 2018 legislation.
Urging the government not to “close the door” on the children affected, Lord Dubs said some lived in “shocking” conditions in French camps at risk of sexual exploitation.
By providing them with a safe, legal route to the UK, peers would be “thwarting the traffickers” and avoiding the need for youngsters to take more dangerous options to get to their families.
Ministers have promised Lord Dubs to maintain the same rights for child refugees, just not through the withdrawal agreement bill.
But the Labour peer has said these pledges cannot be trusted.
It came after twelve councils made a last ditch plea for Johnson to restore the child refugee protections to the bill or risk them being exposed to abuse or exploitation.
The Bishop of Durham, the Rt Rev Paul Butler, said the law as it stood was “hard fought for, not easily won” and warned ministers against conveying a negative message.
The bishop said the issue acted as a “moral bellwether for the future of our country”, adding: “We want to be known as a country that is welcoming and passionate and committed to playing our full part in responding to the deep issues that arise from the reality of refugees around the world.”
Liberal Democrat Baroness Hamwee said: “There is a strong feeling that parliament should not reduce our commitment to these children or to safe and legal routes.”
Baroness Butler-Sloss, a former High Court judge and independent crossbencher, said: “What I am concerned about is urgency.
“It would be very easy for the government, intentionally or unintentionally, with everything else that goes along on Brexit, not to have a priority about these children. What we need to do is to retain the sense of urgency.”
The SNP’s immigration spokesperson Stuart McDonald said Johnson would be “callous and cruel” to overturn the Dubs amendment.
“The amendment brought forward by Alf Dubs is a vital provision that seeks to protect some of the world’s most vulnerable children,” he said.
“Any move by Boris Johnson to overturn the Dubs amendment - which seeks to allow unaccompanied child refugees to be reunited with their families in the UK - would be callous and cruel, and the prime minister would be guilty of abject moral failure.
“We know that Brexit will be damaging economically, but it will also mark a stain on the UK’s standing on the international stage if it was to leave the EU and turn its back on helping child refugees who have endured experiences that no child should.”
Oxfam’s head of humanitarian campaigns, Ruth Tanner, said: “Allowing children who have fled violence or persecution to be reunited with their families is a basic right that should be offered by the UK, whether or not we are part of the EU. Refugee children have been through enough and we owe them the chance to lead safe and dignified lives cared for by the people they love.
“MPs now have the opportunity to show that vulnerable lives are not up for negotiation by supporting this amendment.”