A SUPERIOR COURT judge on Wednesday denied a bid to block Gov. Maura Healey from capping the state’s emergency shelter program, saying the governor was only taking steps to live within the appropriation provided by the Legislature.

“As much as I wish that I possessed the power to ensure that all families who need housing have it, and that all families who require safe emergency shelter are given it, I am persuaded that it would be inappropriate to order the Executive Office of Housing and Livable Communities to continue providing emergency shelter it does not have the resources appropriated by the Legislature to fund,” Judge Debra Squires-Lee wrote in her decision.

The judge also rejected an argument by three families represented by the advocacy group Lawyers for Civil Rights that Healey had to give notice 90 days in advance of making changes in the emergency shelter program. Squires-Lee said the Healey administration did not comply with the 90-day notice requirement, but did alert the Legislature on September 13 that the shelter program was running out of money and needed additional funding to stay afloat.

“The failure to give notice has not injured Plaintiffs where notice is intended to permit the Legislature to act or not act and the Legislature, having actual notice of the fiscal crisis, has failed to act,” the judge wrote.

“It is for the Legislature and not clients of the program to enforce any claimed non-compliance,” she added.

Healey unveiled new emergency regulations for the emergency shelter program on Tuesday, the same day Squires-Lee held a hearing on the challenge filed by Lawyers for Civil Rights. Instead of providing shelter to all poor families and pregnant women lacking housing, Healey set a cap of 7,500 families and said those coming in above the cap would be placed on a waiting list, with openings offered to those most in need.

The shelter system has been overwhelmed by migrants coming from other countries. The original budget for the current fiscal year provided funding to serve 4,100 families, but the actual number of families being served as of last Friday was 7,268. The Healey administration estimates that without implementing the new regulations for the shelter program funding will run out on January 13, roughly halfway through the state’s fiscal year.

In an affidavit filed with the court, Sarah Barrese, the deputy chief financial officer at the housing and livable communities secretariat, warned that failure to restrict spending on the shelter program now could force the administration to give notice in December to shelter operators and contractors for food, transportation, and other services that their contracts are about to be terminated.

After the judge’s ruling, a housing secretariat spokesman said in an emailed statement, “We respect the court process and believe an appropriate outcome was reached. The state does not have enough space, service providers or funding to safely expand shelter capacity.”