A federal judge in New York has ordered a stay on Donald Trump's deportation order for people who have arrived in the US with valid visas from seven Muslim-majority nations.

As thousands of people joined demonstrations at airports across America to protest over Mr Trump’s immigration ban on Muslims, a judge ordered the stay and lawyers said the President’s actions were unconstitutional.

While customs officers appeared to be complying with the court order, the Department of Homeland Security issued a statement saying the President's decree would "remain in place" and the department would "continue to enforce" them.

Protests erupt outside JFK Airport after President Trump's immigration ban

"Prohibited travel will remain prohibited, and the US government retains its right to revoke visas at any time if required for national security or public safety," the statement said.

Earlier, federal judge Ann Donnelly told a Brooklyn courtroom: "I think the government hasn’t had a full chance to think about this.”

She ordered the government to provide a list of names for people affected.

“Stay is national,” ACLU attorney Daniel Ho said on Twitter after the hearing.

As Canadian Prime Minister Justin Trudeau said he would welcome any refugees turned away from the US, protesters at airports from San Francisco to Boston chanted and waved banners denouncing Mr Trump’s actions.

Probably the largest crowds were at New York’s JFK Airport, where at least 11 people were being detained. Anywhere up to a thousand people engulfed Terminal 4 on Saturday night, denouncing Mr Trump and insisting that the refugees be released.

Lawyers and advocates working at the airport said they did not have a hard count on the number of people taken into custody after getting off their flights.

Homeland Security said fewer than one per cent of travellers were "inconvenienced" on Saturday out of the 325,000 who arrived in the country by plane.

It said early on Sunday that 375 travelers had been affected in all, 109 of whom were in transit and were denied entry to the US. Another 173 were stopped by airlines before boarding.

May refuses to condemn Muslim ban

Yosre Ghaled, 25, was among about a dozen distraught people waiting at an airport terminal on Saturday to see if loved ones would be released, or put back on an outgoing plane.

Her mother-in-law’s sister, a 67-year-old Yemeni citizen coming to live with family in the US because she is sick from heart problems and diabetes, was detained after getting off a plane from Saudi Arabia.

“We’re very sad. She lives a very bad life. We try in her last days to (give her) a good life,” Ms Ghaled told the Associated Press.

One protester at JFK, a woman who asked to be identified simply as Lucy, said she had come to protest, to let the world know what was happening.

“It’s important to call congressional and senate leaders and put pressure on them,” she told The Independent.

Griffen Gill, a 21-year-old student, said that that a lot of people may have voted for Mr Trump without expecting that he would enforce the ban.

“I don’t think he has any ideology. He was just hungry for power,” he said.

Nicholas Iossa, said: “I’ve come to represent American values. We have to that this back.”

Speaking in the White House's Oval Office on Saturday, Mr Trump told reporters his order was "not a Muslim ban" and said the measures were long overdue.