The Kenney administration has lost a key round in a contentious, months-long legal battle to block a shelter for undocumented migrant children from opening in Philadelphia, as a Common Pleas Court judge ruled on Thursday that the city had incorrectly applied zoning law.

The for-profit, Arizona-based VisionQuest hopes to soon begin accepting children at its site on Old York Road in Logan, its attorney said Friday, an effort complicated by the company’s decision to lay off its 65-person local staff earlier this week.

“My client is very excited and cautiously optimistic about being able to move forward,” said lawyer Leslie Gerstein. “Whether or not the client is a profit or nonprofit entity, that they’re going to offer shelter to these children is something that is important. Regardless of whether or not you agree or disagree with our country’s immigration policy, these are still children, and they need help.”

Judge Paula Patrick ruled that the Zoning Board of Adjustment erred in concluding that VisionQuest’s plans were inconsistent with the permitted use of the building.

Kenney administration spokesperson Mike Dunn said, “We respectfully disagree with the court’s ruling.… We are reviewing the ruling and will make a decision on how to proceed in the coming days.”

The city’s could appeal to Commonwealth Court, and then, if necessary, to the state Supreme Court, which might or might not decide to hear the case.

Efforts to reach VisionQuest president Mark Contento were unsuccessful Friday. Earlier in the week, he told KYW Newsradio that the agency no longer could afford to pay its local staff while the Old York Road facility sat empty.

Philadelphia, though far from the nation’s southwest border, continues to be a battleground over the rights and treatment of migrants.

The court decision became widely known on a day when a dancing, singing troupe of DACA recipients strode loudly into Philadelphia, marking the halfway point of a New York-to-Washington march to try to save a program that allows migrants who were illegally brought here as children to live and work in the United States.

“The American people support us,” said Carolina Fung Feng, 30, noting that people along the route readily donated supplies, “and they’re showing us their love.”

Fung Feng, whose parents brought her to the U.S. from China, is a plaintiff in the federal lawsuit over the fate of Deferred Action for Childhood Arrivals. That Obama-era program allowed about 790,000 young immigrants to live, work, and attend school in America without fear of deportation.

President Donald Trump ended DACA in September 2017, but the courts blocked that termination. Since then, DACA holders have lived in limbo, wondering if they’ll be deported to countries they don’t know, where they’ve never lived, and where they may not speak the language.

DACA opponents say the federal government must enforce immigration laws fairly and equally, without special provisions and exceptions based on age. The blame for the situation, they say, rests with immigrant parents who knowingly broke the law.

In the “sanctuary city” of Philadelphia, the fight to keep VisionQuest from opening has been joined by City Council members, union leaders, immigrant advocates, and Logan residents. Opponents say the city should never allow immigrant children to be confined within its borders, and particularly not by VisionQuest.

The agency’s previous Philadelphia shelter closed in 2017 after staff members were found to have punched and choked children. Now, the agency will be paid up to $5.3 million by the federal government over three years to house migrant children at the same site.

VisionQuest plans to house a rotating population of Spanish-speaking boys ages 12 to 17, most of whom fled gang violence and poverty in Central America and crossed the U.S.-Mexico border alone.

Those “unaccompanied minors,” once apprehended by border authorities, are transferred to the Office of Refugee Resettlement and then placed within a network of youth shelters. From those shelters, they’re to be released to family members or sponsors in the U.S.

The housing of those children has become a growth industry in the U.S., as large numbers of young people trek north, and the federal government awards millions of dollars in contracts to care for them.

The number of unaccompanied children apprehended at the border spiked to 72,873 in the first 11 months of fiscal year 2019, surpassing the record of 68,541 in 2014, according to the Congressional Research Service.

In suburban Devon, behavioral health provider Devereux is slated to receive an initial payment of up to $14 million to house 42 children ages 5 to 12. That money also will help Devereux plan and potentially open four new shelters and a foster care program in other states. Bethany Christian Services wants to open a 12-bed shelter to house boys ages 15 to 17 in Bensalem.

Bethany and other agencies cast their work as offering crucial help to children who need safety and comfort after traumatic journeys. Opponents say the shelters are a means to profit from the misery of children.