In a decision eagerly awaited by officials across California and the Bay Area, the U.S. Supreme Court ruled Friday that cities are free to clear homeless encampments even when those living on the street have nowhere else to go.

Since 2018, lower court rulings had prevented local governments in Califronia and throughtout the West from arresting or fining people for sleeping on public property if beds weren’t available in homeless shelters.

When cities moved to shut down an encampment, they were generally expected to offer everyone living there shelter or housing. But few cities had the resources to move all their unhoused residents indoors.

Officials from San Francisco to San Diego argued the shelter requirement had hamstrung efforts to close dangerous tent and vehicle camps and exacerbated the crisis. They had urged the high court to allow more flexibility in clearing and managing encampments.

On Friday, Gov. Gavin Newsom cheered the 6-3 decision, which saw the court’s conservative justices forming the majority.

“Today’s ruling by the U.S. Supreme Court provides state and local officials the definitive authority to implement and enforce policies to clear unsafe encampments from our streets,” Newsom said in a statement.

California has an estimated 181,000 people experiencing homelessness on a given night, making up almost 30% of the nation’s homeless population. The nine-county Bay Area has roughly 37,000 homeless residents.

The main question in the case was whether broad camping bans aimed at homeless people in Grants Pass, Oregon, a city of 39,000 with about 600 homeless people, amounted to cruel and unusual punishment prohibited by the Eighth Amendment.

In the court’s decision, Justice Neil Gorsuch wrote that the camping bans could stand, in part because the fines and jail time outlined in the no-camping ordinance are neither cruel nor unusual.

Crucially, the decision also removed the shelter requirement created by the lower 9th U.S. Circuit Court of Appeals. In the opinion, Gorsuch contends that solving the “complex” issue of homelessness should be left to local officials instead of the courts.

“A handful of federal judges cannot begin to ‘match’ the collective wisdom the American people possess in deciding ‘how best to handle’ a pressing social question like homelessness,” he wrote.

Homeless advocates, meanwhile, worried the ruling could clear the way for cities to “criminalize homelessness” and take a more aggressive approach to clearing encampments instead of working to move unhoused residents indoors and preventing people from losing their homes in the first place.

“Today’s disappointing Supreme Court ruling may have put false solutions back on the table,” Brett Andrews, interim chief executive of the Bay Area homelessness solutions nonprofit All Home, said in a statement.

In recent years, homeless advocates had invoked the lower court rulings to sue cities throughout the Bay Area over plans to clear encampments. In San Jose and Oakland, federal judges halted efforts to remove hundreds of people from massive encampments near the San Jose Mineta International Airport and along Wood Street in West Oakland until city officials could provide shelter for those living in the camps.

More recently, a federal court has limited San Francisco’s ability to clear encampments until the city can add more beds for its estimated 4,400 homeless residents living outdoors or in vehicles. That case has been on hold while the court awaited the Grants Pass decision.

Under growing public pressure to address street homelessness, Newsom and local officials in the city and across the state filed legal briefs supporting Grants Pass. While cities said they did not intend to punish people simply for being homeless, they argued that judges had made overly broad and ambiguous rulings in ordering local governments to offer “adequate shelter” and other services before clearing encampments.

In a statement on Friday, San Francisco City Attorney David Chiu said that even in the wake of the favorable ruling, the city “will continue to take a compassionate, services-first approach to addressing our homelessness crisis.”

San Jose Mayor Matt Mahan, who’s pushed to create limited no-encampment zones while rapidly scaling up shelter options, said the the city will continue offering homeless people shelter and services before carrying out sweeps. But he said under the new ruling, local officials now have the authority to cite or potentially arrest homeless people who repeatedly turn down a bed.

“When all else fails, I think they have a choice between accepting shelter or leaving town,” he said. “And if that fails, then I think we have to be more compulsory.”

Mahan also raised concerns that smaller, wealthier cities could pass broad camping bans to push homeless people into major cities like San Jose, adding a statewide strategy for “distributing the solutions to homelessness” is needed to prevent that outcome.

Jeffrey Selbin, a UC Berkeley law professor who’s closely followed the Grants Pass case, said that despite Friday’s ruling, homeless people could still look to the lower courts to halt sweeps. He noted the Grants Pass opinion applies only to Eight Amendment claims, not the right to due process or federal disability protections.

“If cities think that what was making their lives miserable is over in terms of litigation, that’s just not true,” he said.