WASHINGTON, DC - JAN 28: Many homeless people sleep in the walkway area near the entrance to the McPherson Square metro station. (Michael S. Williamson/The Washington Post)

The D.C. government’s struggle to house hundreds of homeless families faced a new crisis this week as city officials announced that they were just one day away from running out of room for those seeking shelter during the peak of winter.

To deal with the latest challenge, the city first asked a judge to lift the obligation to house homeless families in private rooms on freezing nights. But amid a hail of criticism from advocates, the city withdrew the request and said that another set of hotel rooms had been found to house more of the homeless.

Mayor Muriel E. Bowser’s court request for greater flexibility in providing housing, made late Thursday, was the latest sign that city leaders have been unable to keep up with a surge in family homelessness — much of it predicted for months. And her administration’s abrupt withdrawal of the request shows how fraught — and in­trac­table — the issue has become.

More than 2,000 parents and children are now in the city’s troubled family shelter on the shuttered D.C. General Hospital campus or in overflow motel rooms, likely for the rest of the winter. Another 2,000 homeless men and women come and go daily from the city’s dormitory-style shelters for single adults. An average of 12 new homeless families — often single mothers with young children — approach the city for help each night as temperatures have dipped below freezing.

Officials said the new hotel rooms, about 100 of them, should be sufficient to meet the demand for family shelter space over the next seven weeks of expected hypothermia alerts, during which the city is legally obligated to provide housing.

But Brenda Donald, deputy mayor for health and human services, said the rooms are “short-term” and will require the city to do a better job moving families out of shelters and into apartments.

“We have the wide-open front door, and the back door has been really closed,” Donald said.

The District is one of the country’s rare jurisdictions where residents have the legal right to shelter on freezing nights. It is also among the most rapidly gentrifying urban cores in the nation, with an estimated 5,000 families teetering on the brink of homelessness amid rising living costs and escalating home prices.

The city was within a day of running out of motel space for more families, according to the motion, and had yet to find another operator willing to lease additional rooms for the homeless.

The emergency court motion would have let the city place families in makeshift shelters, such as recreation centers, which typically do not offer the privacy required under city law and which Bowser (D) vehemently opposed while campaigning last year.

The filing of the motion generated sharp concerns from advocates, who said they had been in ongoing discussions with city officials about using about 40 rooms at D.C. General that were previously off-limits. They said they were given no indication before Thursday then that such a drastic request was in the works.

Amber Harding, a lawyer with the Washington Legal Clinic for the Homeless, said the motion could have given the city broad authority to put homeless families anywhere, including the makeshift shelters used last year. Harding said she was “very disappointed the administration would pursue what every court has ruled against.”

Before the filing was withdrawn, D.C. Council Chairman Phil Mendelson (D) said he was “troubled” by the breadth of the city’s request in court. “I suspect that the city lawyers felt somehow that strategically it was better to go for more than is needed,” he said. “But politically, it’s a poor choice.”

Late Friday afternoon, the city reversed course.

“Given that there is no longer an emergency, and we anticipate having 100 additional hotel rooms that meet the requirement of the injunction, the District will be withdrawing our motion for relief,” Donald wrote in an e-mail to members of the city’s Interagency Council on Homelessness.

A hearing on the motion set for next week was canceled, according to D.C. Superior Court records.

Allison Holt, one of the pro bono lawyers who filed the suit last year on behalf of families in recreation centers, said she was pleased with the turn of events.

“Our clients will get what the law affords them and their children — safe and secure shelter,” said Holt, of the Hogan Lovells firm. “We hope that should there be a next time, the District is not so quick to claim that finding shelter for one of the city’s most vulnerable populations is ‘impossible.’ ”

Donald said that the additional hotel rooms are in the District and that they should be sufficient to meet the family shelter demand projected for the rest of the cold-weather season.

But she did not rule out pursuing hotel rooms outside of the District, which is not currently permitted under city law. “We’re looking at all options, but we do not see the need to do that at this point,” she said.

A key issue for Bowser’s administration is an inability to transition families out of shelter or motel rooms. Last year, the administration of then-Mayor Vincent C. Gray (D) undertook an effort to move 500 families out of shelter and reached a maximum rate of about 75 departures a month.

But in the waning months of his tenure, that number fell off. And in Bowser’s first month, the rate continued to slow. According to Thursday’s filing, an average of 50 families enter shelter each week and 10 depart.

The administration “works diligently to connect its homeless families with appropriate housing,” the filing said, “but it is simply unable to keep pace with the number of families entering shelter.”

A year ago on the campaign trail, Bowser distinguished herself against Gray, calling “inhumane” his decision to abandon a search for more motel rooms and to place families in makeshift shelters at city recreation centers.

She pledged not to “treat our homeless families like emergency flood victims, housing them in city recreation centers.”

A subsequent lawsuit by homeless families revealed stories of children sleeping in hallways and others afraid to change clothes or to go to the bathroom in front of strangers. The families in recreation centers were forced out each morning without showers, and they often had to spend most of the day reapplying for shelter for the next night.

In March, D.C. Superior Court Judge Robert S. Tignor ordered the District to begin vacating recreation centers, where families were housed with partitions provided by the Red Cross.

He ruled that under D.C. law, families should be afforded a room with “four non-portable walls, a ceiling, and a floor that meets at the edges.” The rooms must be insulated, lock from within and allow occupants to turn off the lights, he said. The ruling was upheld by the city’s highest court and written into statute by a unanimous vote of the D.C. Council — including Bowser.

In Thursday’s filing, the Bowser administration warned of an “impending likelihood that the District will be unable to comply” with Tignor’s ruling from last year.

Bowser on Friday rejected the suggestion that the court filing represented a retreat from her campaign rhetoric and deflected some blame to Gray, who froze spending on some low-income housing vouchers used by families leaving shelters.

“I think what I said, and you would recall, [was] that we didn’t want to move to recreation centers, and that is still my pledge,” Bowser said. The court filing, she added, was “just us making sure we had many options on the table.”