A Chinese neuroscience researcher at Princeton University has been released from an immigrant detention facility in Virginia following her arrest two weeks ago as she tried to catch a flight after a Washington conference, her attorney said.

U.S. District Judge Anthony Trenga ordered Eva Yi Xie to be freed, which happened around midnight Thursday after the ruling, and barred immigration officials from taking her into custody again while her asylum case is pending.

Trenga said that if immigration officials decide to detain her in the future, they must provide her with a notice to appear or "state the change in circumstances that would evidence flight risk or dangerousness." "It is unfortunate that we are in a time that illegal and aggressive ICE arrests require the intervention of the Federal District Court but we are heartened that the rule of law has once again prevailed," Kerry Doyle, Xie's lawyer, said in a news release.