A federal judge has issued an important decision in a lawsuit against the Trump administration policy of having non-Mexican asylum-seekers remain in Mexico while their cases are being adjudicated.

District Judge Richard Seeborg ruled against the Trump administration, and issued a preliminary injunction against them to stop the practice. The order goes into effect on Friday, and the administration has been given that chance to respond to the order.

Judge Seeborg said in the judgement that the plaintiffs had proven that the order to keep them in Mexico "lacks sufficient protections against aliens being returned to places where they face undue risk to their lives or freedom."

"Accordingly, plaintiffs' motion for a preliminary injunction will be granted," he concluded.

He added that he did not rule on whether Congress could put into place a law to send back asylum-seekers to Mexico, only that the Department of Homeland Security had not properly done so in this case.

The decision comes in the wake of Kirsten Nielsen resigning as secretary of the Department of Homeland Security, which includes Immigration and Customs Enforcement.

She had come under criticism from Democrats over the policies that led to family separations at the border.

Here's the latest on Nielsen's DHS exit: