The Trump administration's effort to strip hundreds of thousands of Venezuelan and Haitian migrants of legal protections is unlawful, a US judge has ruled.


The ruling by District Judge Edward Chen sets aside the Department of Homeland Security's (DHS) attempt to end temporary protected status (TPS) for people from countries experiencing conditions that make it dangerous to return.


This decision will allow around 600,000 Venezuelans and 500,000 Haitians to continue living and working legally in the US. The DHS has indicated it will appeal the decision.


The TPS program was established by Congress in 1990 to provide temporary protections for migrants from countries experiencing war and natural disasters.


In a 69-page decision, Judge Chen wrote that DHS Secretary Kristi Noem's action in revoking their protected status was not only unprecedented in the manner and speed in which it was taken but also violates the law. He added that conditions in their home countries were so dangerous that even the State Department advises against travel.


In response to the ruling, a DHS spokesperson told the BBC the scheme had been abused, exploited, and politicised as a de facto amnesty program, while indicating it would assess its legal options.


There are roughly 600,000 migrants from Venezuela included in the TPS program, which was expanded during President Joe Biden's administration to include Haiti, Afghanistan, Cameroon, and Ukraine.


President Donald Trump sought to reverse the extension and eliminate the designation for Venezuela altogether upon taking office earlier this year.


This legal battle continues to unfold as challenges to immigration policies are raised and adjudicated, highlighting the complex nature of US immigration law and policy making.