During the debate on the government’s bill to trigger article 50 of the Lisbon treaty, it quickly became clear that the residence rights of EU and EEA citizens in the UK would be one of the most significant subjects that would occupy both the House of Commons and the House of Lords.

The moral and economic issues were considered in some detail by both houses. But one question has received rather less attention during the public debate: the legal position both of EU citizens in the UK and of UK citizens in the EU.

These matters were considered by the EU justice committee in the House of Lords and the committee that I chair, the joint committee on human rights (JCHR). In a report published in December 2016, the JCHR noted that if the government tried to negotiate over their residence rights, many EU nationals would be able to go to our courts and seek to establish their rights to remain under article 8 of the European convention on human rights (the right to respect for home and private and family life). Such cases could arise in the unlikely circumstances that the government sought to deport EU nationals in the UK. One could also envisage legal challenges by individuals if the government refused to grant a continuation of their current residence rights post-Brexit. If even a small percentage of the individuals affected launched legal proceedings, this would amount to thousands of cases. This would impose an enormous strain on our court system.

I tabled an amendment on the subject of EU residence rights, which was debated in the Commons, but eventually defeated by the government. However, the Commons now has the opportunity to return to this important question as the Lords has passed an amendment to the European Union (Notification of Withdrawal) bill to require ministers to bring forward proposals, within three months of notifying the EU of the UK’s intention to withdraw, to guarantee the EU-derived rights (including residency rights) of EU and EEA citizens who are legally resident in the United Kingdom. I welcome this amendment, which should provide the unilateral guarantee recommended by the JCHR.

During the course of the debate in the Lords, Lord Woolf, a distinguished former lord chief justice and current member of the JCHR, made the legal point on residence rights very clearly. He observed: “We are dealing here with residents in this jurisdiction who at present have the right to go to the European court of human rights. We are also dealing with residents in the rest of the European community who also have that right. The present situation in this country is a matter to be dealt with by parliament and not by the courts. I strongly urge us not to force people to seek to go to the courts, as they could in this situation in this jurisdiction.”

Although the government has raised concerns about UK residents in the EU, they too benefit from rights under the European convention on human rights, so it would not be a straightforward matter for EU states to interfere with their residence rights post-Brexit.

People should be entitled to regulate their affairs in accordance with the law that exists when they make decisions

As the Conservative peer Viscount Hailsham QC noted in the debate, for EU citizens who moved to the UK prior to the referendum their decision accorded with the law that existed then and accords with the law that still exists today. If the UK sought to interfere with their rights, that could effectively involve an act of retrospective legislation.

I agree with Hailsham that, as a matter of general principle, legislation and policies that are retrospective in their operation should be avoided. Individuals should be entitled to regulate their affairs in accordance with the law that exists at the time they make their decisions. As he said, to depart from that principle would expose all of us to risk to our freedoms and our ability to make safe choices.

The bill returns to the House of Commons for its final reading next week; I would urge the prime minister not to seek to overturn the residence rights amendment. This would only prolong the uncertainty for the approximately three million EU citizens who make such an important contribution to our country.