NEW YORK (WPVI) -- President Donald Trump's executive order closing the nation's borders to refugees appears to be in immediate effect.
Refugees in the air or on the way to the United States when the order was signed are being stopped and detained at airports, according to immigration advocates.
Two Iraqi refugees are being held at Kennedy Airport since they arrived overnight. Their immigration attorneys filed a writ of habeas corpus Saturday morning in the Eastern District of New York seeking to have their clients released.
At the same time, those attorneys filed a motion for class certification, to represent all refugees and immigrants.
According to court papers filed in Downtown Brooklyn, one of the Iraqis at Kennedy Airport, Hameed Khalid Darweesh, had worked on behalf of the U.S. government in Iraq for 10 years.
The other, Haider Sameer Abdulkhaleq Alshawi, was coming to the United States to join his wife, who had worked for a US contractor, and young son.
The men arrived on separate flights.
Rep. Jerrold Nadler of New York tweeted that he and Rep. Nydia Velazquez had gone to the airport to try and help the Iraqis:
Meanwhile, seven U.S.-bound migrants - six from Iraq and one from Yemen - have been prevented from boarding an EgyptAir flight to JFK airport.
Officials said the action Saturday by the airport was the first since President Trump imposed a three-month ban on refugees from seven Muslim-majority countries: Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen.
The officials said the seven migrants, escorted by officials from the U.N. refugee agency, were stopped from boarding the plane after authorities at Cairo airport contacted their counterparts in JFK airport.
The airlines flying from this part of the world are updating their travel advisories to reflect the situation.
KLM and Qatar Airways are indicating that green card holders or holders of diplomatic visas (A,G, C-2 or NATO,) from the seven countries are allowed to fly. Tourists and those on study visas are not.
It was a period of limbo for an unknown number of non-American citizens from Iraq, Syria, Iran, Sudan, Libya, Somalia or Yemen now barred from the country where they were studying or had lived, perhaps for years.
A federal law enforcement official who confirmed the temporary ban said there was an exemption for foreigners whose entry is in the U.S. national interest. It was not immediately clear how that exemption might be applied.
Trump's order exempts diplomats.
Those already in the U.S. with a visa or green card will be allowed to stay, according to the official, who wasn't authorized to publicly discuss the details of how Trump's order was being put in place and spoke only on condition of anonymity.
Customs and Border Protection was notifying airlines about passengers whose visas had been canceled or legal residents scheduled to fly back to the U.S. Airlines were being told to keep them off those flights.
(The Associated Press contributed to this report.)