The Bay Area is winding down the grand experiment that sheltered thousands of its homeless residents in safe environments during the pandemic, raising fresh concerns about the spread of COVID-19 as officials scramble to find alternative housing.

Gov. Gavin Newsom launched Project Roomkey in April, a first-of-its-kind program that moved unhoused residents into hotels to protect them from the virus. Six months later, with federal funding sources poised to expire, Bay Area counties are moving to close those hotels — some in the next few months.

The program likely will be remembered as a mixed success. It didn’t come close to reaching everyone who needed help, but Project Roomkey proved that — given the funding and motivation — the Bay Area is capable of quickly mobilizing a vast amount of resources and personnel to attack the homelessness crisis.

The effort also allowed counties to reduce the number of people in shelters and allow space for social distancing, which experts say may have contributed to relatively low positivity rates in many unhoused communities.

“I do think that Project Roomkey has played a huge role in decreasing the disasters in the Bay Area,” said Dr. Margot Kushel, a UCSF professor of medicine at Zuckerberg San Francisco General Hospital and director of the UCSF Center for Vulnerable Populations.

Now Kushel wonders if, without the hotels to rely on, the region can continue avoiding disaster. Experts worry there won’t be enough housing for everyone who was given a hotel room, and the proposed solution — putting the remaining residents back in group shelters — raises new concerns.

“There’s no way to spin it other than to just say there’s an increased risk of an outbreak. That is just the reality,” Kushel said. “I think that county governments are facing very hard choices.”

The Federal Emergency Management Agency, which promised to foot up to 75% of counties’ Project Roomkey bills for an undetermined amount of time, may cut off that funding at any moment. Supplemental funding from the federal CARES Act relief package expires in December. And with negotiations for a second federal stimulus package suspended, local leaders say they have no option but to start emptying the hotel rooms.

“If funding is available, we would like to keep the rooms available to people as long as we need them as part of the COVID response,” said Kerry Abbott, director of Alameda County’s Office of Homeless Care and Coordination. “But we understand that we’ll probably have to taper down as we move people into housing.”

That’s because leasing hotels, staffing them and providing services to take care of medically vulnerable guests is expensive. San Francisco, for example, has more than 2,300 hotel beds in use at a cost of about $18 million a month — or $260 per bed per night. That’s much more than funding a navigation center ($100 a bed per night) or permanent supportive housing ($70 a bed per night).

To catch homeless residents displaced as hotels close, Newsom launched a follow-up program — Project Homekey — which so far has doled out $596 million to cities and counties buying buildings and converting them into long-term housing. He distributed his fourth round of funding Friday, including $3.8 million to Marin County and $10.9 million to Sonoma County.

Since April, Project Roomkey has sheltered about 22,000 homeless Californians in hotel rooms up and down the state. In the Bay Area, the program may have helped slow the spread of the virus by reducing crowding in shelters. Between May 20 and Sept. 21, Santa Clara County tested 3,777 homeless residents living in encampments, shelters and safe parking sites. Of those, 0.9% were positive — compared to an average of 2.39% in the general population as of Sept. 21.

“The numbers are still surprisingly small, and we have yet to see an outbreak in any of our more congregate settings or sites, which is great — really great,” said Dr. Mudit Gilotra, medical director of Santa Clara County’s Valley Homeless Healthcare Program.

Santa Clara County leased roughly 710 rooms in 10 hotels for unhoused residents who are elderly, living with chronic illnesses, or otherwise particularly vulnerable to COVID-19. Officials plan to empty half in the next two months or so. Some of those residents already have been offered spots in three new modular-home sites in San Jose, which are opening more than 300 transitional beds.

Officials expect to close the rest of those hotel rooms by the end of March, said Ky Le, deputy county executive for Santa Clara County. The county’s quarantine hotel rooms — reserved for homeless residents and others who have or may have COVID — could shut down as soon as December.

As of Tuesday, Alameda County was using hotels to shelter 1,064 unhoused people. County officials plan to keep the hotels open at least through Dec. 31, and have moved 121 people from hotels to housing.

The county has lined up funding to place another 700 hotel residents in privately-owned housing with rent subsidies, and the county and the city of Oakland recently won Project Homekey grants to open about 267 more units of housing by the end of the year.

In San Francisco, Project Roomkey hotels will stop accepting new residents at the end of November. City officials plan to empty the hotels by June.

As other housing options fill up, residents in hotels scheduled for closure around the Bay Area likely will be offered beds in group shelters.

That worries experts.

“I remain concerned about the use of congregate shelter,” Kushel said. “I think there are ways to do it more safely if they’re sparsely populated, well ventilated, people wear masks, there’s social distancing within it, and there’s frequent testing. … I think we’re a ways away from that.”