In his most sweeping decision since taking office a week ago, Trump, a Republican, put a four-month hold on allowing refugees into the United States and temporarily barred travelers from Syria and six other countries.
Civil rights and faith groups, activists and Democratic politicians were furious and vowed to fight the order.
Capping a day of confusion and chaos and protests in several airports across the country, a federal judge in Brooklyn, New York, granted a temporary reprieve. The American Civil Liberties Union successfully argued for a temporary stay that allowed detained travelers to stay in the United States.
Supporters outside the Brooklyn courtroom and at protests at airports in Dallas, Chicago, New York and elsewhere cheered the decision, but a bigger fight lay ahead.
The court action does not reverse Trump's order, which was criticized by some of America's closest allies.
Trump, a businessman who successfully tapped into American fears about terror attacks during his campaign, had promised what he called "extreme vetting" of immigrants and refugees from areas the White House said the U.S. Congress deemed to be high risk.
He told reporters in the White House's Oval Office 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.
Along with Syria, the ban affects travelers with passports from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen.
The Department of Homeland Security said about 375 travelers had been affected by the order, 109 of whom were in transit and were denied entry to the United States. Another 173 were stopped by airlines before boarding.