The Department of Homeland Security (DHS) overstepped its authority when it terminated the legal status of thousands of migrants who entered the US using a Biden-era programme, a federal judge has ruled.

Roughly 900,000 migrants who entered at the southern border using the app, CBP One, were generally allowed to remain in the US for two years and given "parole" from immigration laws to work in the country legally.

President Donald Trump's administration last year ended the parole programme and began to use the app for "self-deportations".

Tuesday's ruling restores status to individuals nationwide who received an email, or similar notification, from DHS cancelling their parole.

The Trump administration may seek to appeal the ruling, as they have frequently done in cases challenging their immigration policies. DHS did not immediately respond to a request for comment.