The District employee struggled to open up a hard, green cot when the man she was fixing it for insisted on helping her.

“It might be easier if you turn it around the other way,” the man said. He wore a black hat, black jacket and black boots and carried two small bags. It was about 9:30 Wednesday night when he arrived at the Sherwood Recreation Center near the H Street NE corridor, having no other safe place to go.

Within an hour, about two dozen other homeless residents were in the recreation center with him — some not by choice. The District had enacted its most strenuous measures as the temperature sank below 15 degrees Wednesday night, declaring that every homeless person had to be taken off the streets, even if they refused. Vans crisscrossed the city to find them.

The drivers told them that shelters for adults without children were all filled. Their last resort was one of three recreation centers that served as “warming centers” — places where they could grab a cot and a hot meal and sleep in a heated gymnasium from 9 p.m. until 7 a.m.

It was the second night this year that the city had announced a “cold emergency,” which allows officials to order homeless people into shelters when the temperature hits 15 degrees or below without snow, and 20 degrees when it’s snowing. The warming centers held 295 adults — 41 percent more than at this point last year.

As temperatures plunged, Shamkiya Graybey beds down for the night on the basketball court at one of D.C.'s warming shelters for the homeless at the Sherwood Recreation Center on Wednesday. (Jahi Chikwendiu/The Washington Post)

The numbers illustrated the mounting challenge facing the city as it attempts to fill its moral and legal obligation to house a burgeoning homeless population.

Sheltering single adults overnight is a little easier — the city can place them in recreation centers, but a judge ruled against placing children in similar places. Local advocates worry that the District might not have enough extra units to deal with an influx of homeless families by month’s end, even though the city has rented out two D.C. motels to avert a repeat of last year’s crisis.

Close to 500 families had sought shelter as of Wednesday, about 10 percent more than the week before. And the city’s “exit rate” — its ability to move families out of shelters and into the housing voucher program so other families can move into shelters — has begun to slip, raising concern again that the city might run out of space.

Case managers are also working feverishly to find housing for single men and women to make room in those shelters as well.

The man who was helping the city staffer with the cot, who identified himself only as Cris, had found life in the shelters too unruly. The 62-year-old said he became homeless after asthma attacks and seizures made it impossible for him to keep his job as a research engineer. Before long, he was sleeping on park benches and in apartment lobbies.

“The shelters were full of drug addicts and it was loud, but the streets quiet down after 9 and you can get seven hours of rest,” he said. “In the days, I am in libraries on the Internet trying to keep abreast of technology. But I just want to sleep. If I stay outside tonight, I could die.”

Before he arrived, city employees brought out water and grape soda, snacks and a crate full of oranges. They served chili and white rice. They spread out cots on a basketball court, sprayed them with disinfectant and set up a station so every person could choose a blanket.

As temperatures plunged, homeless women and men prepare to bed down for the night on the basketball court at one of D.C.'s warming shelters for the homeless at the Sherwood Recreation Center on Wednesday in Washington. (Jahi Chikwendiu/The Washington Post)

“People had sense this year,” one van driver, who ferried homeless residents to the rec center, told Dora Taylor, a spokeswoman for the city’s Department of Human Services. Sometimes, the driver said, homeless people refuse to take the ride, no matter the weather. “No one put up a fight. They know it’s cold.”

City employees commented on how much quieter it was inside than last year, when the District ran out of motel rooms and placed families together between partitions in recreation centers. That practice was deemed illegal, so this year there were no children running around as night went on. It was mostly silent, save for the sound of a homeless woman talking to herself and a woman playing songs by Drake on her cellphone.

A man and a pregnant woman squeezed together in one corner. One woman continuously ran her hands through her hair. A man walked around asking for cigarettes. Cris filled out a Sudoku puzzle and spoke to no one.

On the other end of the court, Alicia Bradshaw, 18, buried her face in her hands so no one could see her cry. It was her first night of being homeless. After an argument at home, she walked in on a church Bible study and asked for help. They sent her here.

“I don’t know what I’m going to do,” she said, shivering. “It’s nicer in here than I thought it would be, but I’m not used to this.”

Benjamin Allen III, 50, thanked a city worker for the meal. This was his first winter in the District. He moved to live with his son after spending 25 years in a South Carolina prison, convicted on attempted-murder charges. He said he has found God and inner peace, but his son still harbors resentment. He kicked his father out this summer.

Allen was near Union Station when he heard cold weather was coming. His girlfriend, who is also homeless, began calling the shelter hotline to find a place to stay. The line was busy. She called again. Still busy.

The line was busy still when he headed to sleep under the statue of Maj. Gen. George Henry Thomas in Thomas Circle. He figured he would be cold, but he had heard that spare blankets are always available there. He had walked only a few blocks when a city van picked him up.

“I had 25 years of my life taken away from me, so I value life, and I have to thank God for being here,” Allen said as he finished his chili. “I came to D.C., the nation’s capital, and I learned there are a lot of us out here — trying to get by. But we’re going to make it.”

At 11 p.m., the lights went out. Cris laid down his head. Allen began to snore. Bradshaw fiddled on her phone, unable to sleep. They would be released early the next morning, hoping and praying they might find some place to go before nightfall.