Daniel Young, right, tends to his daughter, Kaylee Young, 1, at a McDonalds while waiting to hear back about finding shelter for the night, on Jan. 21, 2014 in Washington, D.C. At left, Alaysha Simmons, 12, her brothers, Kymari Roberson, 1, middle, and Joshua Simmons, 10, wait for news of a shelter placement for their family as well. Both families waited outside the Virginia Williams Family Resource Center only to find that facility had unexpectedly been closed for the day due to accumulating snow and freezing weather. (Amanda Voisard/For the Washington Post)

District officials violated a city law designed to protect the health and privacy of children by forcing homeless families to sleep barracks-style on cots in recreation centers, an administrative law judge ruled Monday.

The decision throws into question Mayor Vincent C. Gray’s last-resort plan for dealing with a record, 135-percent increase in families seeking homeless shelter this winter — and comes on the eve of a cold snap that could send temperatures plunging below freezing every night for the next week.

The District is one of only a handful of jurisdictions in the country with a right-to-shelter policy on freezing nights. The city began the winter, however, with almost 300 families and no rooms left in its homeless families shelter at the former D.C. General Hospital campus.

With no place for new families, officials started renting motel rooms across the District and Maryland — something Gray has said inadvertently became an attractive option for families doubled up in crowded living conditions.

By last month, the city had more than 400 families in motels and had to halt that practice when officials said they could no longer find long-term rooms to rent. Officials in Maryland, where over 100 families had been sent, had also begun pushing back, saying the influx could overburden county services.

The District this month converted two city recreation centers into shelters, using cots and flimsy partitions provided by the Red Cross, as it might after a flood or other natural disaster.

A lack of partitions, however, created an environment in which families with young children had insufficient privacy when changing and sleeping, ruled Administrative Law Judge John P. Dean.

One woman and her daughter had to share a cot with gaps in the partitions exposing them to other families and strangers, according to the decision. They “slept on cots in a large room with other families, with children of all ages,” Dean wrote.

That situation violated a city law that states the mayor “shall not place homeless families in non-apartment-style shelters.”

Dean ruled that the family had to be moved to D.C. General.

Gray’s administration argued that it has in recent weeks acquired sturdier partitions that can fit together tightly. Dean said he would let a subsequent legal challenge decide if the new partitions are sufficient and Chris Murphy, Gray’s chief of staff, said the city would continue to use the shelter system during this week’s cold-snap.

Another challenge to the partitions is already working its way through the system. Murphy said he was confident the administration would be successful when the new partition system is reviewed. “These cases apply one at a time, they don’t’ say you can’t do this ever for anyone,” he said.

The decision came as D.C. Council member Jim Graham canceled a hearing this week on emergency legislation requested by Gray to give the administration more power to push people out of shelters. It is now unclear if the measure will be brought to a vote next week.