NEW ORLEANS — The rats were coming, hundreds of them headed toward a large homeless encampment just outside the French Quarter. They were swarming the streets and sidewalks, desperate for something to eat after the state closed all the bars and restricted restaurants to takeout orders in response to the coronavirus pandemic.

Most shelters had stopped accepting new residents, leaving no obvious place to house the nearly 200 people living in tents underneath a nearby expressway. With few options left, city and state agencies proposed a solution that is now being emulated across the country: Move people from the homeless camp into a hotel, the Hilton Garden Inn one block off Canal Street.

“Using hotels is something that seems to be catching on in a lot of places, and New Orleans is a leader in that,” said Steve Berg, vice president of programs and policy at the National Alliance to End Homelessness. “We’ve been trying to encourage people to follow that model.”

Last week, California Gov. Gavin Newsom did just that, announcing the state had secured close to 7,000 hotel rooms and hoped for an additional 8,000 to house homeless people who had been exposed to the novel coronavirus, tested positive, or were at a high risk of contracting it. San Antonio and Philadelphia, among other cities, have launched similar plans.

But the New Orleans project also has been the subject of criticism. A medical student who volunteered at the hotel, Alex Niculescu, published this week an email that he wrote to the city public health group that manages volunteer services there. He accused the staff of failing to take necessary precautions to prevent the virus’s spread, including inconsistent use of gloves, masks, sanitizer and social distancing.

He warned that a lack of on-site health-care workers was endangering a population of people at higher risk of becoming severely ill or dying from the coronavirus because of age and preexisting conditions, such as heart and lung disease. The threat is especially dire in New Orleans, which has one of the highest infection and death rates in the country. As of Friday, there were 5,416 coronavirus cases in the city and 225 deaths related to covid-19, the disease the virus causes.

“It is another Lambeth House waiting to happen,” Niculescu wrote, referring to the New Orleans retirement community that has suffered at least 18 deaths, according to local news reports.

In response to concerns at the Hilton, the city on Tuesday moved more than half of the residents out of the 155-room building to another hotel to create more space and smaller, more manageable populations, according to a spokesman for Mayor LaToya Cantrell. The Louisiana Department of Health sent a staff member Wednesday to review measures being taken to prevent communal spread at both sites. In an internal email obtained by The Washington Post, the department determined they were “very clean and were appropriately staffed. Social distancing was demonstrated.”

The hotel project is overseen by a group of state and local entities, including the Louisiana Housing Corporation and the New Orleans Office of Community and Economic Development.

“The idea that everything was perfect from the get-go is in contradiction to us being in emergency response mode,” said Keith Cunningham, executive director of the Louisiana Housing Corporation. “We were making sure people were out of harm’s way of the rat situation, and every step from that point on was to improve.”

In addition to beds and showers, the hotel offers residents laundry services and three meals a day. There is an on-site nurse at all times and medical volunteers who stay in the hotel overnight.

The spacious meeting area on the Hilton’s 11th floor has been transformed into a makeshift social services center. Stacy Horn Koch, director of housing for the Louisiana Office of Community Development, sat at a table this week in the 11th-floor lobby, where government agencies are providing case management services and signing people up for Medicaid and unemployment benefits.

To Koch’s left was 35-year-old Jeffery Solomon, whom she has known for nearly 20 years. He spent most of that time either living on the streets or in prison. The last place he slept was an empty lot.

“I never thought in a million years I would be in a place like this,” he said. “Honestly, it’s too upscale for people like me.”

Koch, who is overseeing the hotel project and has dedicated her professional career to assisting homeless people, quietly admonished him.

“Don’t say things like that,” she said. “It’s not true.”

Two weeks ago, city workers in hazmat suits ushered 196 people living in two homeless camps onto public transit buses and transported them to the Hilton, which sat vacant because of the pandemic. State funds are paying for the space, which officials hope will be reimbursed by the Federal Emergency Management Agency. There is enough money to keep people housed there for only 30 days, and they are already two weeks in.

The operation was not without precedent, said Martha Kegel, executive director of Unity of Greater New Orleans, the city’s largest provider of homeless services. A few years after Hurricane Katrina, the city and Unity relocated about 480 people from two homeless camps into scattered hotel and motel rooms while working to find them permanent housing.

“It was a very fearful time then. You didn’t know what was going to happen to the city,” Kegel said. “But we learned a valuable lesson: Folks who sleep on the street, a large percentage of them won’t go into a congregate shelter. But if you offer them an individual hotel room, virtually no one refuses that.”

Solomon was 20 years old at the time of Hurricane Katrina. He stayed in the Superdome for seven days, during which time, he said, “I saw a whole lot.” The pandemic has brought back the memories and trauma of that experience.

“I look at the news and see the death tolls steadily rising. It makes me think of things that happened during Katrina,” he said. “You never get used to a disaster.”

There is no data that shows exactly how many homeless people have contracted the virus or died as a result, only anecdotes from service providers and people on the streets. Solomon said he knows seven people who exhibited symptoms, four of whom later died.

“That’s the hardest thing, because you see people one day and you don’t think nothing is wrong with them,” he said. “And two or three days later, they’re in the hospital, and they don’t come out.”

Housing nearly 200 homeless people, many struggling with mental illness and substance abuse, in a single hotel has been an enormous challenge, Koch said. In the first two weeks, five people overdosed, a couple of them twice. One person stopped breathing and nearly died, Koch said.

She admits things were hectic in the beginning, but she said she has witnessed a transformation in many of the residents.

“I see them coming off the elevator, and they are clean and happy and feel safe and listened to,” Koch said. “Connecting with the humanity of people most of society chooses to ignore, that to me is very important,”

One 50-year-old resident, who declined to give his last name because of the stigma of homelessness, said the experience has given him a new perspective on life. Jason said he came to New Orleans five years ago after his wife died in Jacksonville, Fla., giving up a lucrative job for a life on the streets.

But waking up in a room with a shower, a toilet and fresh change of clothes has shown him “what normalcy was again.”

“I’m tired. I don’t think I want to be out there anymore,” he said.

Koch has set a lofty goal of finding permanent housing for 75 percent of the residents. But the clock is ticking. The last thing Koch wants to do is send people like Solomon or Jason back to the streets where services now are extremely limited.

The virus has torn through the city’s homeless agencies, rendering many inoperable. Nearly two-thirds of the staff at the Ozanam Inn, which served three meals a day and sheltered nearly 100 people, have covid-19 or are in quarantine.

They stopped food service and are down to 30 residents.

“It’s just scary,” said Executive Director Clarence J. Adams, who has been in quarantine for more than two weeks. “How many people are we going to lose? My staff, some of them have parents they’re taking care of. What is this doing to their families?”

The few remaining providers, with the assistance of the New Orleans Police Department, have teamed up to give three meals a day to those remaining on the street, estimated to be nearly 300, said Sarah Parks, executive director of Grace at the Greenlight, which offers food, clothing and family reunification services.

On Tuesday, more than 200 people formed a line stretching nearly three blocks, carefully spaced six feet apart with yellow and orange cones. Lunch that day was beef stew over rice with green beans, bread and pudding.

“It’s been really hard for the homeless because the one place they could take showers is closed,” Parks said. “Right now, most of the unsheltered haven’t had a shower in weeks. We give them hygiene products like baby wipes, but it’s not enough.”

Two men waiting in line, 58-year-old Tommy Thompson and his 43-year-old friend who asked not to be named because of the stigma, said they sleep at one of the sites where people were picked up and taken to the hotel, but they were not there on that particular morning. And the hotel could fit only so many people. Luck of the draw, Thompson said.

It is good the city housed so many people, his friend added, but hundreds remain on the streets. Everyone is scared of getting sick.

“They declared a national disaster, but there’s nowhere to go for us,” the 43-year-old said, as the pair walked back to the park where they will spend yet another night.