A U.S. federal judge has temporarily halted parts of Trump’s controversial order that aimed to ban citizens and refugees of certain countries from entering the United States.

Trump’s order, which imposes a 90-day ban on entry from citizens of Iran, Iraq, Syria, Yemen, Sudan, Libya and Somalia, has been put forward in a bid to allegedly target “Islamic terrorism”. The order, however, fails to enlist sponsors of extremist ideologies, including Saudi Arabia.

U.S. District Judge Ann Donnelly issued the emergency ruling that bars border agents from removing anyone who entered the United States with a valid visa or refugee permit from the 7 Muslim majority countries subjected to the ban.

“There is imminent danger that, absent the stay of removal, there will be substantial and irreparable injury to refugees, visa-holders, and other individuals,” Donnelly said.

The judge’s ruling came less than a day after two Iraqis were detained at JFK airport in New York. Between nearly 100 and 200 people were also being held at airports or in transit across the U.S.

Trump’s incendiary measure provoked a bitter backslash from thousands of academics, including several Nobel laureates, who denounced the decision and called on the U.S. president to reconsider his decision.

“We, the undersigned academics and researchers from a variety of fields of study, backgrounds, and personal convictions, would like to voice our concern and strongly oppose this measure… We strongly denounce this ban and urge the President to reconsider going forward with this Executive Order," the petition said, calling the executive order “discriminatory”.