San Francisco and Airbnb have reached a deal that ends a lawsuit over the city's law that fines Airbnb for booking rentals not registered with the city.

San Francisco City Attorney Dennis Herrera and Airbnb announced the deal on Monday. Under its terms, San Francisco residents looking to list a rental on Airbnb will be able to apply for a city registration number through the Airbnb website. Airbnb will provide a monthly list of all San Francisco listings to the city, so city officials can verify that a unit is registered.

"There are a lot of folks that have been gaming they system and violating the law, and this is going us the tools," said San Francisco City Attorney Dennis Herrera.

It requires three main changes. First, property owners will be able to access city permits and registration fees on the Airbnb and home away platforms, instead of making a trip to San Francisco City Hall.

Second, hosts who fail to do that will be barred from listing.

And finally, the rental platforms will share data with City Hall to make sure everything is in compliance. There are penalties if that doesn't happen.

"If these companies fail to police the listings on their platform, they themselves will be directly financially liable for their failure, in addition to their hosts. This is a game changer," said Herrera.

SF City Attny Dennis Herrera: AirBNB and Home Away have dropped a lawsuit against the city for passing a law restricting short term rentals. pic.twitter.com/iyTQw5hHto