Boris Johnson’s Brexit deal has suffered three defeats in the Lords and will now have to go back to the Commons.

The first reverse for the Prime Minister was over the right of EU citizens lawfully residing in the UK after Brexit.

Peers backed a cross-party amendment to the European Union (Withdrawal Agreement) Bill allowing them to be given physical proof of their status.

The report stage vote, by 270 to 229, majority 41, means the Bill will have to go back to the Commons, where the Prime Minister will be able to use his big majority to overturn it.

Liberal Democrat Lord Oates warned that without physical documentation EU citizens eligible to remain in the UK would be “severely disadvantaged” in dealings with landlords, airlines, employers and other officials.

In the second defeat, peers voted by 241 to 205, majority 36, to remove the power of ministers to decide which courts should have the power to depart from judgments of the European Court of Justice (ECJ) and by reference to what test.

A third defeat followed rapidly, as peers backed a move by Tory former lord chancellor Lord Mackay of Clashfern to allow cases to be referred to the Supreme Court to decide whether to depart from EU case law.

Voting on this amendment was 206 to 186, majority 20, as peers warned against interference in the independence of the judiciary.

Liberal Democrat Lord Beith said he understood the Government had agreed to move an amendment at third reading to meet concerns raised about making “bad law”.

But he said this had been withdrawn because “10 Downing Street is in a sulk” due to the earlier defeat on the Bill.

Lord Mackay warned of the test being an “interference with judicial independence,” which was not proper.

He said the Lords should help the Government “to do properly what they want to do” by asking the Commons to think again.

Leading lawyer and independent crossbencher, Lord Pannick branded the Government’s proposals “fundamentally objectionable”.

Lord Pannick, who acted for businesswoman Gina Miller in two Brexit-related court cases, said it gave ministers a delegated power to decide which courts should be able to depart from ECJ judgments and what test should apply.

“These are powers which step well over the important boundary between the Executive and the judiciary,” he insisted.

“These amendments are absolutely nothing to do with the merits of Brexit, the terms on which we leave the EU, the timetable for Brexit.”

For the Opposition, Lord Goldsmith warned the Government’s proposals risked “uncertainty” and the “independence of the judiciary”.

Brexit minister Lord Callanan, rejecting the amendments, said an important principle was involved that “UK courts should be able to interpret UK law”.

Lord Callanan assured peers the Government would implement the policy in a sensible way and consult with senior judiciary.

He said the power could only be used before the end of the implementation period and there was no way a minister could “interfere with a live case” – allowing time to consult, consider and “soberly extend the jurisdiction of UK courts to the historic case law of the ECJ”.

Following the vote, Liberal Democrat leader in the Lords, Lord Newby said: “The Conservative Government is trying to use this Brexit legislation to undermine both the rule of law and parliamentary sovereignty. Liberal Democrats will fight them every step of the way.

“Despite Boris Johnson’s talk about bringing the country together, his approach seems designed to divide it even further.

“Certainty that lower courts will follow the rulings of higher ones is a crucial part of our legal system. By removing it, the Conservatives would cause chaos and confusion.”