Airbnb has capitulated to the demands of lawmakers over its operations in New York City, the company’s largest market in the United States, agreeing to drop a lawsuit in which it was pushing back against a newly passed state law that it said could have hurt its business.

The short-term home rental service on Friday settled the lawsuit that it filed against New York City two months ago. The suit challenged a New York law that Gov. Andrew M. Cuomo signed in October. That law called for fines of as much as $7,500 for illegally listing a property on a rental platform such as Airbnb.

The company had said the large fines could have deterred hosts and impaired its revenue in New York City. Hosts in the city generated about $1 billion in revenue last year, and the company took a cut of that in fees.