Washington — A federal judge in Maryland on Wednesday blocked a directive by President Donald Trump that would allow states and local governments to reject the resettlement of refugees in their communities. The ruling is a temporary blow to the White House's concerted efforts to dramatically overhaul the nation's decades-old refugee program.

Judge Peter Messitte of the U.S. District Court in Maryland granted a request made in November by several refugee resettlement groups to prohibit officials from implementing an executive order issued in September that required states and local governments to provide written consent to the relocation of refugees from around the world to their jurisdictions.

Through a nationwide injunction, Messitte blocked the State Department, the Department of Homeland Security and the Department of Health and Human Services — all of which oversee the nation's refugees — from enforcing the president's order. A spokesperson for the State Department said officials are reviewing the injunction, but did not comment further.

Get Breaking News Delivered to Your Inbox

The administration has defended the executive order by saying it is a way to give local communities input into refugee resettlement. But advocates and three refuge groups that asked Messitte to halt the order, HIAS, Church World Service and Lutheran Immigration and Refugee Services, believe the newly created veto power by state and local authorities violates U.S. law and creates enormous challenges for people fleeing persecution around the world and seeking protection in the U.S.

Messitte appeared to agree, writing in his ruling that the new policy could prompt many refugees to "find themselves at least in limbo, denied services congressionally intended to help them effectively integrate into new homes."

Defending the injunction, Messitte said the executive order does "not appear to serve the overall public interest" because it contradicts "clear statuary text and structure, purpose, Congressional intent, executive practice, judicial holdings, and Constitutional doctrine."

The ruling by Messitte, an appointee of former President Bill Clinton, is a victory for refugee advocates and resettlement agencies, which depend on federal funds to carry out their humanitarian work. Under Mr. Trump's order, any jurisdiction that did not consent to refugee resettlement would not receive funds to do so. Last week, Texas Republican Governor Greg Abbott became the first governor to opt out, but Messitte's ruling effectively renders Abbott's controversial decision obsolete for now.

"We're grateful for this interim decision that, for the time being, will allow refugees to continue to be resettled throughout the country," Scott Arbeiter, president of the refugee resettlement group World Relief, said in a statement. "Local church partners in those communities are grateful that, at least until a further court decision, their volunteers will continue to be able to welcome refugees as an expression of their faith."

Most states, including conservative leaning ones, have voiced their support for refugee resettlement in the wake of Mr. Trump's executive order, with Democratic and Republican governors writing letters of consent.

Since the passage of the Refugee Act of 1980, the United States' refugee program has long enjoyed broad bipartisan support. But it has been decimated over the past three years by the Trump administration, which dramatically slashed the number of refugees the U.S. is helping to resettle, recently imposing an 18,000-person cap, the lowest ceiling in U.S. history.

President Obama set a 110,000 year cap for his final year in office. Mr. Trump reduced that number to 45,000 in fiscal year 2018, to 30,000 in fiscal year 2019 and to 18,000 for the next 10 months.

White House Press Secretary Stephanie Grisham in a statement called the ruling "preposterous."

"President Trump rightly and justly recognized that your communities are unique, and while some cities have the resources to adequately support refugees and help them be successful, not all communities can sustain the substantial and costly burden," Grisham 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," the statement concluded.