IN A STUNNING reversal, the Trump administration has agreed to abandon its earlier order for international students to leave the country if their college or university is only offering online classes during the fall.

US District Court Judge Allison Burroughs made the announcement in a brief video hearing Tuesday afternoon in a lawsuit brought by Harvard University and the Massachusetts Institute of Technology challenging the government rule issued eight days ago.

“The government has agreed to rescind the July 6, 2020 policy directive,” Burroughs announced during the two-minute hearing on Zoom that had more than 600 people logged on to watch. The agreement moots the plaintiffs’ motion for a preliminary injunction on a nationwide basis.

The case was brought by Harvard University and the Massachusetts Institute of Technology, which combined have over 9,000 international students. They sought a temporary restraining order on US Immigration and Customs Enforcement implementing the policy, which was vacated by the agreement on Tuesday afternoon.

The Trump administration’s plan would have limited foreign student visas, known as F-1 visas, to those taking in-person classes in the US.

It would have deported students who were not taking in-person courses, or hadn’t transferred to universities with in-person courses in the coming weeks. The move brought outcry from over 200 colleges and universities that signed on to Harvard and MIT’s lawsuit, and also brought about at least seven other lawsuits from other major universities around the US. The University of Massachusetts, which has more than 7,000 international students, also signed onto the suit.

“If allowed to stand, ICE’s policy would bar hundreds of thousands of international students at American universities from the United States in the midst of their undergraduate or graduate studies,‘’ Harvard and MIT wrote in their lawsuit. “ICE’s decision reflects a naked effort by the federal government to force universities to reopen all in-person classes notwithstanding their informed judgment that it is neither safe nor advisable to do so. The effect — perhaps even the goal—is to create chaos for schools and international students alike.”

Burroughs said the government has agreed to guidance issued in March after the initial outbreak of coronavirus in the US, but noted that the case remains open.

The March 2020 Department of Homeland Security guidance allowed foreign students in the US to remain legally while taking online courses and authorizes the entry of new foreign students to arrive for the next semester.

Harvard University junior Lavinia Teodorescu was listening to Tuesday’s hearing and said she is “beyond happy to hear they fully rescinded the F1 students directive.” She called it a “big surrender from the Trump administration, which is unexpected.”

Teodorescu, who is from Romania, has been stranded in Europe, unable to return to Boston for an internship with nonprofit immigrant advocacy group Immigrants Like Us.

“I can go back on campus and work now, and my friends who stayed in the US are safe. I think this is incredible news, and I’m happy I can continue my studies there,” she said.

Attorney General Maura Healey filed suit yesterday also challenging the ICE rule along with 16 other state attorneys general and the District of Columbia.

“For the hundreds of thousands of international students across this country who enrich our institutions and strengthen our communities – we celebrate this victory with you,” Healey said in a statement following today’s announcement in federal court. “This ICE rule was senseless and illegal the minute it came out, and the Trump Administration knew it didn’t have a chance. This is why we take action in court, why we stand up for our values, and why we will remain vigilant in protecting our international students from these harmful disruptions.”