The US government has paused its extensive visa crackdown after terminating the legal status of thousands of foreign students over the past few weeks. The Donald Trump-led administration told a federal judge on Friday that would be restoring registrations for pupils whose legal status had been terminated abruptly. The announcement also follows a wave of lawsuits filed by students who were notified about revocation of their legal right to study in the US — often without any obvious cause.

According to reports, the decision was annonced during a court hearing on Friday. The federal judge had been hearing a challenge from one of the many international students who are now suing the Trump administration. A hardline crackdown on immigration had left thousands of foreign students in the lurch after their records were terminated from a database of the approximately 1.1 million foreign student visa holders — revoking their legal status and putting them at risk of deportation.

The crackdown had begun earlier this month with immigration agents arresting many foreign students over alleged links to pro-Palestinian protests. Top officials within the Trump administration had also called for students to ‘self deport’ in many cases. The curbs were later expanded to target thousands of foreign students over minor (or non-existent) offenses — with many being detained or arrested.

According to the American Immigration Lawyers Association, records for more than 4,700 students have been removed from a database maintained by the US Immigration and Customs Enforcement since Trump took office on January 20. The information bank also monitors compliance with visa terms and records foreign students’ addresses, progress toward graduation and other information. Student visa holders have to obey conditions such as limits on employment and avoiding illegal activity in order to to remain in the database.

University groups have said that the cancellations, which stoked fear on campuses, risked scaring off foreign students who are a source of global talent and contributed $44 billion to the US economy last year. More than 200 students have reportedly won court orders temporarily barring the administration from taking action against them after being removed from the Student and Exchange Visitor Information System (or SEVIS).

According to a Reuters report, US District Judge F Dennis Saylor said he had received an email from a lawyer from the government alerting him to a change in position by ICE shortly before a Friday hearing. It claimed that ICE was now “developing a policy that will provide a framework for SEVIS record terminations”. SEVIS records for such plaintiffs would remain active (or be restored) until this new policy was issued.

The Department of Justice later clarified that students reinstated in SEVIS comprised both those who sued the government and those who did not. U.S. Department of Homeland Security spokesperson Tricia McLaughlin however said in a statement that they had not reversed course on visa revocations but restored SEVIS access “for people who had not had their visa revoked.”