Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal judge in New York has granted a stay order on President Donald Trump’s executive order temporarily restricting entry to the U.S. by those from seven predominantly Muslim countries.

The stay blocks the deportation of those who arrived in the U.S. with a valid visa, as well as those from Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen who are legally authorized to enter the country. It also protects those with approved refugee applications. They stay does not mean those detained have to be released.

"Stay is granted," Dale Ho, executive director of the American Civil Liberties Union Voting Rights Project said on Twitter. "Stay is national."

Crowds outside federal court in Brooklyn cheered the news. The ACLU, which sought the emergency stay, said the judge ordered a list of detainees to be provided, and said it would go through the names and ensure they are released.

"But the critical point tonight is no one can be sent back to one of these countries," attorney Lee Gelernt, deputy director of the ACLU Immigrants' Rights Project, said.

Related: Trump Travel Restrictions Leave Refugees Stranded

The executive order signed by Trump on Friday puts in place a 120-day hold on entry of refugees to the U.S., and indefinitely suspends the admission of Syrian refugees until the president is satisfied that changes have been made to U.S. programs.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

It also suspends entry for 90 days from certain nations based on statute related to the Visa Waiver Program. The most recent version of that program lists Iraq, Syria, Iran, Sudan, Libya, Somalia, and Yemen.

Critics blasted the order as "Muslim ban," which Trump has denied. Trump said the order was necessary to keep foreign terrorists out of the U.S. The president on the campaign trail and after taking office called for "extreme vetting" of some entering the country.

Saturday's stay was the first time a judge blocked parts of one of Trump's executive orders since he took office last week.

Related: Syrian Refugees See Dream of Better Life Crushed by Trump Ban

Protests erupted in several airports across the U.S. Saturday over the executive order, which turned into celebrations after the stay was granted. Demonstrators at a terminal at Dallas/Fort Worth International Airport chanted "USA! USA!" and "Set them free!"

The ACLU had filed a lawsuit on behalf of two Iraqi refugees who were detained after arriving at New York’s John F. Kennedy Airport following the order. They were later released, and a senior Trump administration official said waivers would be granted. The ACLU then filed a motion seeking a nationwide stay.

Celebrations break out at Brooklyn courthouse after judge grants stay temporarily blocking Pres. Trump's exec. order https://t.co/79a2DpjqmB — MSNBC (@MSNBC) January 29, 2017

Anthony Romero, executive director of the ACLU, said the group believes around 200 people will be directly affected by Saturday’s stay.

"Clearly this is just the first day of what will be a very long battle," Romero said.

A senior Department of Homeland Security official said that in the first 23 hours of the order 109 travelers were denied entry to the U.S. upon arrival from the seven countries, and 173 were prevented from boarding flights to the U.S. On Saturday a total of 375 travelers were affected, the official said.

Demonstrators shout slogans during anti-Donald Trump immigration ban protests inside Terminal 4 at San Francisco International Airport in San Francisco on Jan. 28, 2017. KATE MUNSCH / Reuters

The ACLU in Massachusetts said two UMass associate professors who are legal residents from Iran were among those being detained due to Trump's order. The Legal Aid Justice Center said between 50 and 60 were detained at Washington Dulles International Airport were detained, and that a federal judge in Virginia ruled they must be allowed to speak to lawyers.

Stanford PhD student Nisrin Elamin Abdelrahman, a legal U.S. resident and green card holder from Sudan, said she was detained for five hours after arriving on a flight to JFK late Friday.

After putting her green card into the machine her picture returned with an 'X' on it, she said, but employees at first said she should be processed the normal way. Then a supervisor said, "Well, hold up. We just got a message," she recalled.

"There was an element of my situation that was comic," she added. "I was just as confused as the officers. They didn’t know what was going on. It was clear they were waiting on Washington to respond to them."

Abdelrahman was eventually released at 4:30 a.m. Saturday, and said she was humiliated and saddened by the experience. "I was really heartbroken for the people who I saw being sent back," she said.

It wasn't immediately clear what will happen to those who have visas but are currently detained in the U.S. under Trump's order. The Department of Homeland Security said late Saturday it will comply with judicial orders.

"The courts work the way they’re supposed to work in our country," Gelernt, the ACLU lawyer said. "The president could not override the courts."