Cities continue to tighten their grip around Airbnb and other short-term rental sites, and Santa Monica, California, is no different.

In the latest loss, Airbnb and Expedia Group’s HomeAway lost their case in the Ninth Circuit Court of Appeals to the city of Santa Monica. This means the previous ruling still stands that the short-term rental companies are liable for illicit rentals on their sites.

In Santa Monica, short-term rentals must be licensed by the city. If they aren’t, the companies will now be responsible for taking them off the site.

“This critical local law prevents residences in our community from being converted into de facto hotels – it protects affordable housing and it helps residents stay in their homes,” Santa Monica City Attorney Lane Dilg said in a statement.

And while the short-term rental sites tried to argue this regulation would make it impossible for the sites to operate, the three panel judges disagreed.

“Even assuming that the ordinance would lead the platforms to voluntarily remove some advertisements for lawful rentals, there would not be a severe limitation on the public’s access to lawful advertisements, especially considering the existence of alternative channels like Craigslist,” the judges said in the ruling.

Santa Monica’s regulations are among the strictest in the nation. They prohibit rentals of whole homes to travelers for less than 30 days. Vacation-rental hosts in the city can only rent rooms to tourists and must be present throughout the stay.

As for the city, it is pleased with the ruling and called it a win for housing and affordability.

“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,” Mayor Gleam Davis said. “This is a big win for Santa Monica residents and our residential neighborhoods.”

But Santa Monica isn’t the only city Airbnb is fighting. New York City is upping the ante in its fight against Airbnb, as the two sides battle it out in court and in the court of public opinion.

New York City Mayor Bill de Blasio recently announced that the city is issuing a subpoena to Airbnb, demanding that the short-term rental site turn over the listing data that’s at the center of a legal battle between the two sides.

Last year, New York passed legislation designed to combat the rise of short-term rentals in the city. The law prevents landlords and tenants from illegally renting out apartments for a few days at a time to tourists.

And Massachusetts recently passed a law that extended the state’s current 5.7% hotel tax to most short-term rentals, along with giving municipalities the option of tacking an additional 6% onto the tax; 9% if an owner rents out two or more units in the same community.

But despite all of these battles, the company seems to be remaining optimistic.

“Airbnb has made great strides around the world, working with dozens of cities to develop more than 500 partnerships including fair, reasonable regulations, tax collection agreements, and data sharing that balance the needs of communities, allow hosts to share their homes in order to pay the bills and provides guests the opportunity to affordably visit places like the California coast,” the company said in a statement.