Airbnb is fighting back.

The home-rental site filed a lawsuit Monday (June 27) in federal court alleging rules recently passed by the city of San Francisco violate free speech and privacy laws.

On June 7, the city’s board of supervisors voted 10-0, with one abstention, to require short-term rental websites, such as Airbnb and VRBO, to post only the listings of residents registered with the city. Companies that don’t comply can be fined up to $1,000 a day. Airbnb is seeking to block the ordinance, which is supposed to take effect next month.

Currently, Airbnb hosts are required to register with the city. The rules, though, have been difficult to enforce, and only about 1,300 hosts have registered. There were more than 9,000 active listings on Airbnb in San Francisco in March.

Airbnb says the new ordinance violates two federal statutes: the Communications Decency Act and the Stored Communications Act. Under these laws, Airbnb argues that it is not liable for content created by its users and not required to disclose user records to the city without a subpoena.

“Nothing in San Francisco’s pending ordinance punishes hosting platforms for their users’ content,” says Andrea Guzman, a representative of the city attorney office. “In fact, it’s not regulating user content at all—it’s regulating the business activity of the hosting platform itself.”

San Francisco has long grappled with regulating sharing-economy startups, many of which are headquartered in the city. In April, it required Uber and Lyft drivers to obtain business licenses and began investigating Airbnb hosts in violation of its short-term rental laws. City supervisor David Campos, who proposed the more restrictive rules passed this month, has also accused Airbnb of exacerbating San Francisco’s housing crisis, asserting that landlords are removing rental units from the market in pursuit of greater profits on Airbnb.

Airbnb, for its part, says it shares the city’s “concern about unwelcome commercial operators converting affordable rental housing to illegal hotels” and adds that it has removed 200 listings in San Francisco this past year.

“We recognize the need for platforms like Airbnb to play a bigger role in helping the City prevent the loss of affordable rental stock,” Airbnb said in a blog post. “While we have attempted to work with the City on sensible, lawful alternatives to this flawed new ordinance, we regret that we are forced to now ask a federal court to intervene in this matter.”