Freedom of movement for EU nationals was to be abolished using the upcoming Immigration Bill

The government’s plans to end freedom of movement at midnight on October 31 have been torn up after lawyers warned that ministers risked losing a court case that would derail no-deal preparations.

Priti Patel, the home secretary, signalled last month that freedom of movement would legally end when the UK leaves the EU.

However, plans to change the law in one move were shelved when lawyers hired by the Home Office said this could cause chaos. Freedom of movement for EU nationals was to be abolished using the upcoming Immigration Bill, but that will not become law in time for the Halloween deadline.

Ministers then explored plans to use provisions in the European Union Withdrawal Act that would allow ministers to change the law without