A San Francisco judge dismissed criminal charges Thursday against three homeless people who were arrested for camping or sleeping on the streets, a decision that follows a federal appeals court ruling barring cities from prosecuting such cases when no shelters are available.

District Attorney George Gascón, who has announced a new policy of charging people with illegal camping only when they reject an offer of an available shelter, did not challenge the dismissals. But Gascón and Public Defender Jeff Adachi’s office appear to be at odds on what a city has to do to make shelters “available.”

In a Sept. 4 ruling, the Ninth U.S. Circuit Court of Appeals in San Francisco reinstated lawsuits by homeless people challenging ordinances in Boise, Idaho, that made it a crime to sleep on a sidewalk or to use any sidewalk or public property as a “camping place.” The court said the constitutional ban on cruel and unusual punishment prohibits criminal penalties for “sitting, sleeping, or lying outside on public property for homeless individuals who cannot obtain shelter.”

A city might be able to prohibit “sitting, lying, or sleeping outside at particular times or in particular places,” the court said. But it said a city cannot prosecute homeless people for “involuntarily” doing such things “so long as there is a greater number of homeless individuals in a jurisdiction than the number of available beds in shelters.”

Assistant Public Defender Brian Pearlman, managing attorney of the misdemeanor unit in Adachi’s office, said Thursday that the Boise ruling would prohibit San Francisco from arresting anyone for sitting or lying on a sidewalk, because the city does not have enough shelter beds for all of its homeless population.

“The court said that if a city doesn’t have enough resources to house all of its homeless people, you’re punishing people for their (homeless) status,” Pearlman said. Otherwise, he said, “you could have one bed available and 30 people being cited.”

Superior Court Judge Samuel Feng did not address the issue of available beds directly Thursday when he dismissed the charges because police had not offered shelter space to the three homeless people before arresting them. Maxwell Szabo, a spokesman for Gascón, did not rule out arrests in future cases under a state law that makes it a crime to lodge in any place, public or private, without the owner’s permission.

“Absent an offer of shelter, prosecuting (cases under that law) is not only unconstitutional, it’s inhumane and ineffective,” Szabo said in a statement. “But where an individual rejects the offer of an appropriate shelter bed and continues to block sidewalks and throughways, (anti-lodging) citations can continue to serve as a tool to maintain quality of life and intervene with community members being on our streets who may be unable to make decisions that are in their own self-interest.”

The San Francisco Police Department did not respond to a request for comment.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko