Federal judges in Boston have issued a temporary stay against President Donald Trump's order blocking refugees and nationals from seven majority Muslim countries from entering the United States. 

The decision, issued at 2 a.m. Sunday, imposes a seven-day restraining order on the ban on entry for legal permanent residents of Massachusetts from Iran, Iraq, Yemen, Somalia, Sudan, Libya and Syria as described in Trump's Jan. 28 executive order. 

“This is a huge victory for justice,” said Matthew Segal, legal director of the ACLU of Massachusetts. “We told President Trump we would see him in court if he ordered this unconstitutional ban on Muslims. He tried, and federal courts in Boston and throughout the nation stopped it in its tracks.”

The ruling prohibits customs and border agents from detaining or deporting green card holders, approved refugees and others named in Trump's order from being detained or forcing them through additional screening processes based solely on Trump's order.

Federal District Court Judge Allison D. Burroughs and Magistrate Judge Judith G. Dein issued their ruling on a suit filed on behalf of two lawful permanent residents detained at Logan Airport.

Mazdak Pourabdollah Tootkaboni and Arghavan Louhghalam — both Muslim, Iranian nationals teaching at the University of Massachusetts — were detained at Logan Airport Saturday upon re-entry to the U.S. after attending an education conference abroad.

The professors were released, but lawyers sought the federal court ruling to prevent others being affected by the executive order. The judges agreed.

"Absent a stay of removal, petitioners and others similarly situated, including lawful permanent residents, citizens, visa-holders, approved refugees, and other individuals from nations who are subject to the Jan. 27 Executive Order, are likely to suffer irreparable harm," the judges' ruling stated.