Washington, DC (CNN) A federal judge in Maryland has temporarily blocked President Donald Trump's executive order that allows governors to stop refugee resettlement in their states.

In a preliminary injunction issued Wednesday, US District Judge Peter Messitte said the executive order "does not appear to serve the overall public interest."

The judge's order comes after three refugee resettlement agencies sued the government over the executive order

"Refugee resettlement activity should go forward as it developed for almost 40 years before Executive Order 13888 was announced," Messitte wrote in his opinion

"As for the public interest, there is without a doubt public interest in keeping 'the President from slipping the boundaries of a statutory policy and acting based on irrelevant policy preferences,' " Messitte added, quoting from a law review article

Thirty-nine states have said they intend to continue to place refugees in their states. Of those, 17 are led by Republicans. Only one, Texas, has said it will not.

Leaders of the resettlement agencies said Wednesday that they were thrilled with the judge's decision and that it would allow them to continue to resettle refugees across the country.

As a result of the ruling, US refugee resettlement agencies can proceed with funding requests without having to obtain letters of consent from state and local officials.

"It means that we can continue to ensure that all refugees get a bright start in the United States, regardless of who is in office in the states and cities where they live," said the Rev. John L. McCullough, president and CEO of Church World Service.

The ruling comes days after Texas Gov. Greg Abbott announced that under the executive order's provisions, his state wouldn't be accepting refugees

States have until June 1 to provide consent for refugee resettlement, including submitting proposals for federal funding later this month, creating a de facto deadline of Jan. 31.

Over the course of Trump's presidency, the administration has slashed refugee admissions to historic lows . This fiscal year, the administration set a cap, which dictates how many refugees may be admitted to the US, of 18,000, down from 30,000 the previous year.

The Justice Department declined to comment.