The US administration on Tuesday rescinded a rule that would require foreign students to transfer or leave the country if their schools held classes entirely online because of the coronavirus pandemic. The administration of President Donald Trump faced eight federal lawsuits and opposition from hundreds of universities if it went ahead with the plans. The decision was announced at the start of a hearing in a federal lawsuit in Boston filed by Harvard University and the Massachusetts Institute of Technology. US District Judge Allison Burroughs said federal immigration authorities agreed to retract the July 6 directive and “return to the status quo". A lawyer representing the Department of Homeland Security and US Immigration and Customs Enforcement would only say that the judge’s comments were correct. The announcement brings relief to thousands of foreign students who were at risk of being deported from the US, and hundreds of universities that were rushing to reassess their plans for autumn. With the policy rescinded, immigration authorities will revert to a directive from March that suspended limits around online education for foreign students. Under the policy, international students in the US would have been forbidden from taking all of their courses online in the autumn term. New visas would not have been issued to students at schools that were planning to provide all classes online, which includes Harvard. Students who are already in the US would have faced deportation if they did not transfer schools or leave the country voluntarily. Immigration officials issued the policy last week, reversing earlier guidance from March 13 telling colleges that limits around online education would be suspended during the pandemic. University leaders believed the rule was part of Mr Trump’s effort to press the nation’s schools and universities to reopen this autumn, even as new virus cases rise. The policy drew backlash from universities, with more than 200 signing court briefs supporting the challenge by Harvard and MIT. They said the policy would put students’ safety at risk and hurt schools financially. Many schools rely on tuition from international students, and some stood to lose millions of dollars if the rule had been kept. Harvard and MIT were the first to contest the policy, but at least seven other federal suits had been filed by universities and states opposing the rule. The unexpected decision was welcome news to anxious students across the country. “I feel relief,” said Andrea Calderon, 29, a biology graduate student from Ecuador. “It would have been a very big problem if I had to leave the country right now.” Ms Calderon, who is studying at the City College of New York, said going home would have made it much harder to finish her thesis and pursue a PhD. Internet access in Ecuador is unreliable and going through the process to return to the US later would be too expensive, she said. The American Council on Education, which represents university presidents, praised the retraction of the "misguided" policy. “There has never been a case where so many institutions sued the federal government,” said Terry Hartle, the group’s senior vice president. “In this case, the government didn’t even try to defend its policymaking.” But some opponents were hesitant to call it a closed case. Massachusetts’ Democratic Attorney General, Maura Healey, who is leading a separate lawsuit against the policy, said the Trump administration might again attempt to impose limits on international students. “This is why we sue," Ms Healey said on Twitter. "The rule was illegal and the Trump administration knew they didn’t have a chance. “They may try this again. We will be ready.” Harvard and MIT said immigration officials breached procedural rules by issuing the rule without justification and without allowing the public to respond. They said the policy contradicted the immigration authority's March 13 directive telling schools that limits to online education would be suspended “for the duration of the emergency". The suit said Mr Trump’s national emergency declaration had not been rescinded and that virus cases were surging in some regions. But immigration officials said that they told universities all along that any guidance prompted by the pandemic was subject to change. They said the rule was consistent with existing law barring international students from taking classes entirely online. Federal officials said they were providing leniency by allowing students to keep their visas, even if they study online from abroad.