LONDON (Reuters) - Britain’s government has abandoned plans to end freedom of movement for European Union citizens immediately after a possible no-deal Brexit and will instead return to an earlier policy of giving them three years’ temporary leave to remain.

The fate of EU migrants had been thrown further into confusion by the government’s announcement last month that their automatic right to live and work in Britain would end abruptly - and sooner than expected - in the event of a no-deal Brexit.

But the government was forced to back away from the plans amid warnings that they may face a legal challenge from some of the millions of EU nationals already living in Britain.

The plan was branded reckless by lawyers, which said it could result in millions of EU nationals who were legally resident in Britain but had not yet applied for settled status losing some of their rights.

Instead the government will grant all EU nationals entering Britain between the planned Brexit date at the end of October and the end of 2020 a three-year right to remain.

The Home Office said applications for temporary leave would open once Britain had left the bloc without a deal and involve a “simple online process” including identity, security and criminal record checks.

Reuters has reported on cases of EU nationals, who have been living in Britain for decades, who say they are being denied the right to permanently reside in the country after Brexit because they are having difficulty documenting their status.

The government’s EU settlement scheme aims to register EU nationals living in Britain, giving them a new legal right to remain.

But so far only about 1 million of the estimated more than 3 million EU nationals living in Britain have registered to remain.

(Corrects final paragraph to add dropped word ‘million’.)