Refugees who were flying into the United States when President Donald Trump signed an executive order banning refugee entry Friday were stopped and detained when they landed in the country.

The order suspending all refugee entry for 120 days went into immediate effect Friday night, putting an undetermined number of refugees who were on airplanes when it was signed in legal limbo, reports The New York Times. Lawyers for two Iraqi refugees who were detained when they landed at Kennedy Airport in New York quickly filed legal challenges.

“We’ve never had an issue once one of our clients was at a port of entry in the United States,” one of the lawyers, Mark Doss, told The New York Times. “To see people being detained indefinitely in the country that’s supposed to welcome them is a total shock.”

Trump’s order also bans admission of refugees from Syria indefinitely, and bars anyone from the countries of Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen from entering the country for 90 days. The order leaves room for exceptions to be granted on a case by case basis, according to the “national interest,” and establishes a policy of prioritizing Christian refugees and other refugees of a minority religion in their country over Muslims.

The lawyers representing the two detained Iraqis, Hameed Khalid Darweesh and Haider Sameer Abdulkhaleq Alshawi, told TheNYT they were not allowed to meet with their clients when they learned they had been detained. When they asked who they should talk to regarding their case, a Customs and Border Protection agent reportedly told them to “call Mr. Trump.”

They filed a writ of habeas corpus early Saturday in New York demanding their clients be released, and filed a motion for class certification so that they might represent all refugees and immigrants who say they are being unlawfully detained.

“These are people with valid visas and legitimate refugee claims who have already been determined by the State Department and the Department of Homeland Security to be admissible and to be allowed to enter the U.S. and now are being unlawfully detained,” Doss told TheNYT.

Darweesh worked on behalf of the U.S. government in Iraq for 10 years, and Sameer had worked for a U.S. contractor, the lawyers said. The complaints were filed by a group including the American Civil Liberties Union, a lawfirm and the International Refugee Assistance Project at the Urban Justice Center.

[dcquiz] Trump’s order cites his authority as president to protect the country from terror attacks by foreign nationals in the order, as well as the power granted to him that is explicitly outlined in the Immigration and Nationality Act to refuse entry of any foreign national deemed “detrimental” to U.S. interests.

“Whenever the President finds that the entry of any aliens or of any class of aliens into the United States would be detrimental to the interests of the United States, he may by proclamation, and for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate,” the 1952 law states.

Follow Rachel on Twitter

Send tips to rachel@ dailycallernewsfoundation.org.

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.