Immigration and Customs Enforcement rescinded a Trump administration rule Tuesday that would have required international students to transfer or leave the country if their schools held classes entirely online because of the pandemic.

The decision was announced at the start of a four-minute-long hearing in a federal lawsuit brought by Harvard University and the Massachusetts Institute of Technology. U.S. District Judge Allison Burroughs said federal immigration authorities agreed to pull the July 6 directive and “return to the status quo.”

A lawyer representing the Department of Homeland Security and U.S. Immigration and Customs Enforcement said only that the judge’s characterization was correct.

Tuesday’s ruling came amid a maelstrom of similar lawsuits — one from Attorney General Maura Healey and 17 other states, and eight others filed by universities across the country. By Monday, more than 200 universities had publicly backed the MIT/Harvard lawsuit, arguing that it would jeopardize their plans for the upcoming fall semester and create a health risk for students, faculty and others.

While ICE did not formally publish the new rules, the agency gave schools a Wednesday deadline to file “operational change plans.”

ICE did not immediately respond to a request for further comment.

Under the policy, international students in the U.S. would have been forbidden from taking all their courses online this fall. New visas would not have been issued to students at schools planning to provide all classes online, which includes Harvard. Students already in the U.S. would have faced deportation if they didn’t transfer schools or leave the country voluntarily.

Tuesday's announcement brought relief to thousands of foreign students who had been at risk of being deported.

“We’ve all been stressed for days that we might have nowhere else to go, and now everyone is so happy that they can just stay on campus,” Harvard undergraduate student Lavinia Teodorescu said during an interview with WGBH News Tuesday.

In the past week, students like Teodorescu, a Romanian citizen, have had to face the possibility that they could lose their jobs, or their ability to attend school, Teodorescu said.

“This decision was really critical for international students because it's not just about where in this world you're going to have classes,” she said. “It's about people from Syria — will they let them back into the U.S., if they deport them? Other people, like myself, are working. I can't work if I'm not there.”

Harvard President Larry Bacow called Tuesday's announcement a "significant victory" in a statement posted to Harvard's website.

"This show of support is heartening. We all recognize the value that international students bring to our campuses, to this nation, and to the world," Bacow said in the statement. He added, "The ICE directive sought to force each of us to choose between the health of our communities and the education of our international students—a false and dangerous choice which we rejected. In the end, the public overwhelmingly agreed with us, and the government, in response, withdrew its order."

In the initial brief filed by MIT and Harvard, the universities called the ICE rule “arbitrary and capricious in multiple respects,” calling on the agency to justify its position and “identify any reasoned basis for the agency’s decision,” which they argue “appears driven by a different agenda altogether” than the government’s recommendation for universities to reopen.

In its 23-page response, ICE argued that it did consider the impact on schools, and was therefore not “arbitrary and capricious.” If they had not, “perhaps the agency would have completely rescinded its March 9, 2020, broadcast message and reverted back to enforcement of the black letter of the regulations, returning to business as usual as before the Covid-19 emergency,” it argued. “To have done so would have severely limited the options for schools.”

ICE also argued that the schools could not justify the claim of “irreparable harm” suffered by students. “Petitioners do not explain how physical presence in the United States is required for one to participate in a 100 percent online learning experience,” the response read.

Teodorescu argues that for her personally, the potential harm of this rule could have been life-changing. “I don't have health insurance outside the U.S., and during this pandemic, it’s much more dangerous,” she said. “I know a lot of people, they don't have a home, and there is no ‘back home’ to go to, even though they're international students.”

The Associated Press' Collin Binkley contributed to this report.