Advocates for the homeless rally outside the ARTIC train station in Anaheim on Jan. 29, 2018. Housing Is a Human Right, an advocacy group, is one of the plaintiffs in a new lawsuit over the lack of emergency shelters in south Orange County. (Jill Replogle/LAist)

For months, a federal judge has been warning cities in south Orange County to open more homeless shelters or get sued. On Wednesday, they did.

Lawyers representing homeless plaintiffs and homeless advocacy groups filed a class action suit against Irvine, Aliso Viejo, Dana Point, San Juan Capistrano and San Clemente. The County of Orange is also a defendant, since the sheriff's department provides law enforcement for much of south OC.

The lawsuit alleges that homeless people have no way to comply with laws prohibiting sleeping and loitering in public places because they have no option of sleeping indoors. The complaint is essentially an expansion of a lawsuit that the same group of lawyers filed last year against the county and various cities in central and north OC.

The initial lawsuit led Anaheim and Santa Ana to open shelters in recent months. Tustin and Costa Mesa are scheduled to open shelters in the near future. And Placentia and Buena Park have identified potential shelter locations and have been holding public meetings due to the lawsuit.

In the legal complaint filed late Wednesday against south OC cities, lawyers allege that homeless clients have no choice but to violate anti-camping and anti-loitering laws since there is nowhere for them to sleep indoors. The County of Orange is also named in the suit since county sheriff's deputies enforce local laws in most of the cities named.

The complaint is based largely on a 2018 ruling from the Ninth Circuit Court of Appeals, which found that homeless residents in Boise, Idaho, could not be criminalized for sleeping outdoors if they had no alternative. The judge overseeing an earlier case, Jones v. City of Los Angeles, came to a similar conclusion.

U.S. District Judge David Carter, who presides over the 2018 Orange County case, repeatedly warned south OC cities last year to find shelter space or face litigation. He also warned that homeless people might flock to cities in the southern part of the county as other OC cities build shelters and thereby can enforce anti-camping and anti-trespassing laws.

"People aren't stupid who are homeless, they're going to figure out the beach looks like a pretty nice place," Carter said at a court hearing in August.

Earlier last year, the Orange County Board of Supervisors sought to locate emergency shelters on county-owned land in Irvine, Laguna Niguel and Huntington Beach. But they scrapped the idea after an outcry from neighbors and threats of lawsuits from elected officials in those cities.

Later, a group of south OC mayors suggested turning a library in remote Silverado Canyon — located in the foothills of Orange County — into an emergency shelter. But that plan was also scrapped.

Currently, the only emergency shelter for homeless men and women in south Orange County is one in Laguna Beach called the Alternative Sleeping Location. The shelter sleeps 45 people nightly, according to its website.

The 2019, federally mandated homeless count, which took place in January, found more than 400 homeless people living on the streets in south Orange County, according to Voice of OC. The official results aren't expected to be made public until April.

At least 23 homeless individuals died in south Orange County cities last year, according to a recent report from the Orange County Coroner. Eight of them perished in their cars; another seven died on the streets.

Read the new legal complaint below: