Airbnb has been forced to remove almost 5,000 properties in San Francisco from its listing site.

A new law, which came into effect last year, requires homeowners and room renters on the site to register with the city of San Francisco. The deadline to register was on Tuesday (16 January) at midnight. About 4,500 failed to make the cutoff, and were subsequently removed from Airbnb.

San Francisco is the hometown of Airbnb and is still the worldwide headquarters for the company. Under city laws, people can lease their property for up to 90 days a year when vacant and can rent rooms as often as they would like.

Registration costs $250 and anyone caught skipping out could be hit with a fine of up to $1,000. San Francisco revealed the changes in 2015 but faced a stubborn legal battle from Airbnb to legally pass them. After a year of courtroom negotiations, the two parties settled on Airbnb managing the registrations.

San Francisco city attorney Dennis Herrera said the law was a "game-changer". "This agreement helps protect the city's precious housing supply by obligating these companies to ensure that all their listings are legal and properly registered," Herrera said.

"The settlement will also make it easier for residents who follow the rules to supplement their income by renting out a spare room or their home while on vacation."

Airbnb spokeswoman Mattie Zazueta said the company was happy to work with the city. "We are proud to have worked with lawmakers in our hometown to create clear, fair home sharing rules that ensure every listing on the Airbnb platform is in full compliance with local regulations and protect our business over the long term," Zazueta said, according to Cnet.

Listings in San Francisco now include a registration number as part of the profile. The owners of the rooms/houses used a process called the "pass-through registration system" to apply. Details are sent to Airbnb and then passed on to the city for approval.