A federal appellate court says cities can't prosecute people for sleeping on the streets if they have nowhere else to go because it amounts to cruel and unusual punishment.

In a ruling handed down Tuesday, the 9th U.S. Circuit Court of Appeals sided with six homeless Boise, Idaho residents who sued the city in 2009 over a local ordinance that banned sleeping in public spaces. The ruling could impact several other cities across the western U.S. that have similar laws.

Story Continues Below

Four years ago Boise changed its anti-camping rule to say that homeless campers couldn't be prosecuted unless all the local homeless shelters were full. But the appellate court said that didn't fix the problem because some of the shelters require religious programming and all of them limit the number of days a homeless person can stay. That means homeless campers could still face prosecution even if the shelters had open beds.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.