SANTA MONICA (CBSLA) — Short-term home rental services like Airbnb and Homeaway.com suffered a blow Wednesday after the Ninth Circuit Court of Appeals sided with the city of Santa Monica in its fight against home sharing.

The two home-sharing behemoths had sued, claiming the seaside city’s “Home-Sharing Ordinance” violated the Communications Decency Act – since the legislation would require them to monitor and remove third-party content — and the First Amendment. A unanimous panel of three Ninth Circuit judges upheld Santa Monica’s right to regulate home sharing to protect its limited housing stock for residents.

“We are thrilled to have confirmation from the Ninth Circuit that our balanced approach to home sharing is working at a time when housing and affordability continue to challenge the region,” Santa Monica Mayor Gleam Davis said in a statement.

Santa Monica had prohibited short-term rentals in residential districts for decades, but eased the prohibition in 2015 by allowing residents to become licensed to host visitors for pay for less than 31 days. The new ordinance required residents to be present during the “visit.” The regulation was aimed at helping residents supplement their incomes through home-sharing, but also to keep homes from being converted into de facto hotels.

The legislation was further amended in 2017 to keep businesses like Airbnb and Homeaway from providing or collecting a fee for booking services for unlicensed short-term rentals.

Airbnb was reportedly making millions from illegal listings in Santa Monica, according to the Santa Monica Daily Press.

Judge Jacqueline H. Nguyen noted in her opinion that Santa Monica, just eight square miles serving 90,000 residents and as many as 500,000 visitors on weekends and holidays, struggles to manage the disruptions brought by short-term rentals.