Updated at 6:15 p.m. ET
A federal judge in Maryland has blocked the Trump administration's executive order allowing state and local governments to turn away refugees from resettling in their communities.
In September, President Trump announced that groups that help refugees find places to live must first get written consent from local and state jurisdictions before resettling them.
Immigration advocates challenged the executive order in federal court, calling it cruel and shortsighted.
U.S. District Judge Peter Messitte said the executive order "does not appear to serve the overall public interest."
In his 31-page opinion issued Wednesday, he wrote that the order gives states and local governments "the power to veto where refugees may be resettled — in the face of clear statutory text and structure, purpose Congressional intent, executive practice, judicial holdings and Congressional doctrine to the contrary."
Messitte's ruling is a preliminary injunction, putting on hold enforcement of Trump's refugee resettlement order.
The White House press office released a statement that said, "This is a preposterous ruling, one more example of nationwide district court injunctions run amok, and we are expeditiously reviewing all options to protect our communities and preserve the integrity of the refugee resettlement process."
Lawyers for three advocacy groups that went to court over the issue — Church World Service, Lutheran Immigration and Refugee Service, and HIAS — said in the lawsuit that Trump's move violated the Refugee Act of 1980, which declares that it is a policy of the U.S. to encourage refugees fleeing persecution to be resettled in America.
"The objectives of this Act are to provide a permanent and systematic procedure for the admission to this country of refugees of special humanitarian concern to the United States, and to provide comprehensive and uniform provisions for the effective resettlement and absorption of those refugees who are admitted," Messitte wrote.
Trump's executive order, the judge wrote, appears to run counter to the Refugee Act.
"This ruling shows the country how this administration was wrong to attempt a state-by-state refugee ban," said Mark Hetfield, president and CEO of HIAS. "An overwhelming majority of governors and municipalities have already expressed their desire to continue welcoming refugees. To those few who have not, we say not only is it unkind and un-American to ban refugees from your states and towns, but it is unlawful."
Texas recently announced it would become the first state to reject refugees since Trump issued the executive order.
"Texas has been left by Congress to deal with disproportionate migration issues resulting from a broken federal immigration system," Gov. Greg Abbott said in a letter released last week.
The latest cap marks the lowest number of refugees seeking protection from violence or political persecution that will be allowed into the country since the modern refugee program was established in 1980.