The Trump administration on Tuesday said it is withdrawing a proposed rule that would have forced foreign students to return home if the college courses they were enrolled in were to be held entirely online when colleges reopen in the fall.

Immigration and Customs Enforcement (ICE) announced last week that those on F-1 and M-1 student visas would need to leave the U.S. or transfer to another college if their schools offer classes entirely online when they reopen in the fall. If they do not, they could face deportation proceedings.

HARVARD, MIT SUE OVER ICE DEMAND THAT FOREIGN STUDENTS LEAVE US IF COURSES ARE ONLINE-ONLY

Additionally, the agency announced that the State Department will not issue visas to students enrolled in full online programs, and that U.S. Customs and Border Protection (CBP) would not allow them into the country.

But the administration said it was rescinding the rule as a court hearing was getting underway on a lawsuit challenging the rule by Harvard University and the Massachusetts Institute of Technology (MIT). According to the courtroom clerk's notes, the court was informed that both sides "have come to a resolution" and the government "has agreed to rescind the July 6, 2020 Policy Directive and the July 7, 2020 FAQ, and has also agreed to rescind their implementation."

The lawsuit by Harvard and MIT had sought a temporary restraining order and a preliminary injunction stopping the policy from being enforced. According to The Harvard Crimson, Harvard had announced days earlier that it would house no more than 40 percent of undergraduates and would hold all classes online in the fall.

In a statement to students last week, Harvard President Larry Bacow said that the policy “came down without notice -- its cruelty surpassed only by its recklessness.”

“It appears that it was designed purposefully to place pressure on colleges and universities to open their on-campus classrooms for in-person instruction this fall, without regard to concerns for the health and safety of students, instructors, and others,” he said.

A coalition of 17 states and the District of Columbia on Monday announced they were also suing the Trump administration in an effort to block the policy, which the lawsuit called the government’s “cruel, abrupt and unlawful action to expel international students amid the pandemic that has wrought death and disruption across the United States.”

17 STATES, DC SUE TRUMP ADMINISTRATION OVER FOREIGN POLICY SHIFT 

The lawsuit claimed that the administration failed to consider the tremendous costs and administrative burden it would impose on schools and that remote learning may not be possible for international students in their home countries.

They also argued that the policy imposes financial harm to colleges and universities, and pressures them to offer in-person classes amid the coronavirus pandemic “or lose significant numbers of international students who will either have to leave the country, transfer or disenroll from the school.”

But immigration restrictionists on Tuesday expressed disappointment at the move, with the Federation of American Immigration Reform (FAIR) accusing the White House of buckling "under pressure from the business lobby, as well as college professors and administrators who hate everything about President Trump and immigration restriction."

CLICK HERE TO GET THE FOX NEWS APP

"Remember, foreign students aren’t simply studying abroad in the eyes of businesses -- they’re soon to be employees under [Optional Practical Training] who are more enticing to them than American college students struggling to find jobs," FAIR's head of government relations RJ Hauman told Fox News. "And on the college front, they’re worried that there will be less demand around the world for astronomically high tuition rates if classes are online, instead of including residency with a path to employment and permanent immigration."

Fox News' Brooke Singman and The Associated Press contributed to this report.