Airbnb is celebrating. The online vacation and short-term apartment rental company won a victory in court Thursday after challenging the city on new regulations for the company that were set to begin in February. A federal judge told the city: not so fast.

"When a judge does a temporary injunction, there is still a whole lot of legal process to be had, and we believe we will ultimately prevail," Mayor Bill de Blasio said at a news conference.

The law passed the City Council with unanimous support last July. It would require Airbnb and similar companies to hand over detailed information about listings to the city. The city was demanding the address of each rental and the name of the apartment host, as well as the length of the stay. Airbnb and Homeaway.com argued that the law violated the Fourth Amendment's protection against illegal searches and seizures.

Thursday's decision puts the brakes on the law temporarily, ensuring the lawsuit has time to proceed.

But the judge wrote in his decision that he thinks Airbnb is likely to succeed in its case in the end.

"Look, we think this is a good law," the mayor said. "This is a law to stop landlords from creating de-facto hotels, which is unfair and illegal, which creates real security problems for neighbors."

"The decision today is a huge win for Airbnb and its users, including the thousands of New Yorkers at risk of illegal surveillance who use Airbnb to help make ends meet. The court today recognized the fundamental importance of New Yorkers' constitutional rights to privacy and the sanctity of their own homes," a spokeswoman for Airbnb said Thursday.

The city intended to use the information provided by Airbnb to crack down on people found to be operating illegal hotels. The state does not allow anyone to rent out an entire apartment for less than 30 days if the owner or tenant is not also staying in the home.