On Monday Airbnb filed a lawsuit in federal court against its hometown of San Francisco in response to new short-term rental rules. 

The two parties had worked together a few years ago, when sanctioned guidelines to help tenants make rent each month in the costly city were passed.

But now, Airbnb -- one of the most anticipated IPOs of the year -- says the rules aren't working.

According to a blog post released Monday from the $25.5 billion-company, an ordinance passed June 7 by the San Francisco Board of Supervisors imposes a $1,000 fine for every unregistered host advertised by the short-term rental company. That means the city will impose penalties on the company if a host does not post a registration number, and if the registration number is not valid. 

That registration costs $50, a fee large enough to deter some hosts using short-term rental to pay their monthly rent.

Kevin Kopelman with Cowen Group said these controversies may cause some headwind, but that the company has enough growth to sustain itself. 

"We believe the high willingness to try Airbnb shows that positive word-of-mouth and positive press on Airbnb are significantly outweighing skepticism and negative press surrounding Airbnb's legal/regulatory battles," Kopelman wrote in a note obtained by Bloomberg earlier in the year.

In the blog post, Airbnb claims the ordinance violates the First Amendment and the Communications Decency Act, which prohibits states and local governments from holding internet platforms liable for content created by people who use their website. 

"Over the last year, we have held eleven town hall meetings to explain the registration process, repeatedly emailed hosts to encourage them to register, and convened scores of meetings with individual hosts to help walk them through the required registration steps," the blog post read.

In February Airbnb agreed to make the registration process mandatory, however, it was apparently unsuccessful in getting all hosts to do so. It also agreed to put a 90-day cap on short-term rentals for entire homes.

The blog post states the San Francisco Board of Supervisors' ordinance, a "hastily-crafted proposal," violates federal law and will prevent thousands of San Francisco residents trying to pay rent each month.

There is an ongoing debate in San Francisco that Airbnb has inflated affordable housing, allowing landlords to convert cheaper apartments into short-term spaces for rent. This controversy has led to what many say are unfair evictions for Airbnb renting purposes. The New York Times reported  only about 20 percent of about 7,000 residents who rent out their apartments for less than 30 days have registered with the city.

Hotel chains have supported the legislation --Airbnb is notably valued higher than giants like Wyndham (WYN) ($7.45 billion) and Hyatt (H) - Get Report ($6.1 billion)-- and not just in San Francisco. A similar blame has been cast on the company in New York, where a pending bill may ban online advertising for Airbnb and companies like it.

The bill will make it possible for hosts to rent rooms or part of their living space, but illegal to rent out an entire apartment. It is already illegal to rent an apartment for less than 30 days in New York. First-time offenders would be fined $1,000 and repeat offenders would have to pay $7,500 for every additional online listing.

French tourism company AhTop on Saturday filed a suit saying Airbnb was unfair competition.

Airbnb partnerships exist in more than 190 countries today, and have hosted more than 60 million travelers, according to its website.

"We will do it at a time when it benefits the company," CEO and co-founder Brian Chesky told the Wall Street Journal in January 2014. "When we have a good reason."