The Trump administration on Tuesday rescinded a directive from U.S. Immigration and Customs Enforcement that some feared could have led to the deportation of thousands of international students enrolled at U.S. colleges if the pandemic prevented them from attending in-person classes.

The decision was announced by a federal judge in Boston as she prepared to hear a challenge brought by Harvard University and Massachusetts Institute of Technology to the policy that said international students who took only remote classes could be forced to transfer or leave the country.

The July 6 ICE directive ignited panic on campuses across the country at a time when many schools are trying to balance the need to resume classes while keeping their students and staff safe. The lawsuit by Harvard and MIT condemned the agency and the U.S. Department of Homeland Security for using the policy in a bid to “encourage schools to reopen.”

It prompted other suits, including one filed by attorneys general from 18 states, saying the ruling was a threat to public health.

The suits also alleged the ruling violated the Administrative Procedure Act for failing to provide rationale for the decision, defying the legal amount of time required for public response, and contradicting the agency’s earlier policy regarding international students.

At the start of the hearing Tuesday, U.S. District Judge Allison Burroughs said federal immigration authorities agreed to pull the directive and “return to the status quo.” She didn’t elaborate and an ICE spokesperson didn’t respond to a request for comment.

But the announcement brought waves of relief to international students.

“I woke up my parents in the middle of the night and shared the news — that’s how important this decision was,” said Aphrodite Biswas, a rising junior at Pennsylvania State University from Mumbai. “It certainly brings a lot of relief to all of us because now I know that I will not be kicked out of the country if my university switches to remote learning halfway through the semester.”

Biswas added that she was not surprised things turned around so quickly after the lawsuits were filed, but expressed disappointment in the directive in the first place.

In March, U.S. customs officials had announced a policy that allowed international students to remain in the United States for their education even as most schools moved instruction online due to COVID-19. The March 13 exemption stated that the policy would remain “in effect for the duration of the Emergency.”

Last week’s abrupt change was announced without any advance warning or discussion, and left international students, faculty, and university administration blindsided.

“My first reaction was this must be a fake link; there is so much fake news going on,” said Nikhil Parakh, a rising third-year student at Drexel University from Kathmandu, Nepal. He called Tuesday’s reversal of that decision “the highlight of my day” and credited the efforts of students and universities who put pressure on the administration via lawsuits and petitions.

Dipanshi Agarwal, a rising junior at Temple University from New Delhi, credited social media for the policy turnaround.

“The awareness people raised on social media says a lot about the power social media holds,” she said. “Oftentimes, it feels like we’re screaming into the void, but it really does yield results.”

University of Pennsylvania president Amy Gutmann, who joined Harvard and MIT’s lawsuit, said she was pleased with the decision.

“We are unrelenting in our commitment to continue fighting for our international students to ensure that they are treated as equal members of our educational community,” she said in a statement. “Today we can celebrate an important step forward in that effort.”

This article contains information from the Associated Press.