President Donald Trump's order to restrict people from seven Muslim-majority countries from entering the United States sparked outrage but hit a roadblock late on Saturday when a federal judge said stranded travelers could stay in the country.

The emergency court ruling was cheered at Boston's Logan International Airport, one of several major U.S. airports where protesters angry with Trump's order gathered.

The American Civil Liberties Union, which sought the temporary stay, said it would help 100 to 200 people with valid visas or refugee status who found themselves detained in transit or at U.S. airports after Trump signed the order late on Friday.

It was a dramatic end to Trump's first week in office, capped by the Republican president's four-month ban on refugees entering the United States and a 90-day hold on travelers from Syria and six other countries.

Trump had promised during his campaign what he called "extreme vetting" of immigrants and refugees to try to prevent terror attacks.

He told reporters in the White House's Oval Office earlier on Saturday that his order was "not a Muslim ban" and said the measures were long overdue.

"It's working out very nicely. You see it at the airports, you see it all over," Trump said. The White House could not be immediately reached for comment on the emergency court ruling.

Senior officials at the U.S. Department of Homeland Security told reporters they had not seen the ruling, but said the government would implement any appropriate orders.