Home-sharing site Airbnb said Wednesday it will give some “anonymized” user information over to authorities as New York cracks down on the illegal renting of units by large corporate property managers. 

The agreement ends a six-month back-and-forth between the startup and the New York Attorney General's office, which requested data about Airbnb’s New York hosts last fall.

Under a revised subpoena, Airbnb will hand over user names and New York-based apartment units/numbers using unique "anonymous" identifiers. 

The Attorney General’s Office will then have one year to review the data and request personal-identifiable information, including names, e-mail addresses, payment information, phone numbers and social media account information, of individual hosts subject to further investigation. 

This comes a week after a judge ruled that the initial demand was overboard, but said a new, narrower subpoena would require Airbnb to turn over personal information about hosts. 

The San Francisco-based company, which offers a platform enabling people to rent out their homes to travelers, said it believes authorities are focused on large corporate property managers and hosts who take apartments off the market and disrupt communities.

It claims to have already removed more than 2,000 listings in New York and says it believes “many’ are no longer listed on Airbnb. 

“We now believe we have reached an agreement that will protect the privacy of thousands of Airbnb hosts, while allowing the Attorney General to investigate bad actors and move us forward,” said David Hantman, head of global public policy for Airbnb.

The battle and subsequent agreement highlights the intensifying battle between Washington D.C. and Silicon Valley over user data.

Tech giants like Facebook (FB) and Google (GOOG) have pushed back hard against data requests from the government in an effort to protect user privacy.

In fact, The Washington Post recently reported that some tech companies are notifying subpoenaed users against the government’s will as they try to win back the public’s trust following last year’s NSA surveillance program revelations.

Airbnb was careful to defend its own agreement with New York on Wednesday, saying it pushed back against the subpoenas several times, ultimately challenging the subpoena in the New York State Supreme Court.

“It took a long time to reach this agreement, with lots of hard work on both sides,” Hantman said. “We wanted to do everything we could to avoid turning over data on thousands of regular New Yorkers.”

Follow Jennifer Booton on Twitter at @Jbooton