A federal judge dealt a blow to Mayor Bill de Blasio's attempted crackdown on Airbnb and other "home sharing" services on Thursday, blocking a citywide effort to force the short-term rental company to disclose sensitive information about its users.

The law, which was set to go into effect next month, would have required that Airbnb and similar companies like Homeaway.com to share the names, addresses, telephone numbers, and email addresses of hosts, as well as rental info about guests, so that the city could more easily target scofflaws. The vast majority of Airbnb-type rentals are currently illegal in New York, though that hasn't stopped landlords and tenants from renting out their units to out-of-towners for days or weeks at a time, exacerbating the city's housing crisis.

The New York Civil Liberties Union had previously raised privacy concerns over the way the law requires Airbnb and similar sites to provide host names, addresses, and contact information to the Mayor's Office of Special Enforcement, along with details on when, how long, and for what fee those people rented out their spaces.

Over the summer, Airbnb filed a lawsuit attempting to block the regulation, which they called an "extraordinary act of government overreach." On Thursday, Judge Paul Engelmayer sided with Airbnb, issuing a preliminary injunction pending the outcome of the ongoing litigation.

In his decision, Engelmayer said that the city's law may violate the Fourth Amendment's prohibition on illegal searches and seizures. "The city has not cited any decision suggesting that the governmental appropriation of private business records on such a scale, unsupported by individualized suspicion or any tailored justification, qualifies as a reasonable search and seizure," Engelmayer wrote in the ruling.

Asked about the injunction at an unrelated press conference this afternoon, de Blasio told reporters, "We felt we were well within the law. We have a huge city with a lot of Airbnb activity and a lot of concern in our neighborhoods and, unfortunately, a lot of examples of abuse. And to put a strong data regimen in place made all the sense in the world. So I think it's a good law and we're certainly going to fight for it, legally."

Attorneys for the city did not immediately respond to a request for comment.

"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," Liz DeBold Fusco, a spokesperson for Airbnb, said in a statement. "The court today recognized the fundamental importance of New Yorkers' constitutional rights to privacy and the sanctity of their own homes."