The Trump administration has dropped its plans to deport international students whose courses move fully online because of the coronavirus pandemic.
The U-turn comes just one week after the policy announcement.
The Massachusetts Institute of Technology (MIT) and Harvard University sued the government over the plan.
US Immigration and Customs Enforcement announced the decision as a court hearing was getting underway on a challenge to the rule by Harvard University and the Massachusetts Institute of Technology.
District Judge Allison Burroughs in Massachusetts says the parties have come to a settlement.
The agreement reinstates a policy implemented in March, amid the virus outbreak, which allows international students to attend their classes virtually if necessary and remain legally in the country on student visas, according to the New York Times.
Large numbers of foreign students travel to the US to study every year and are a significant source of revenue for universities.