ALBANY — Gov. Andrew M. Cuomo on Friday signed a bill that prohibits the advertising of short-stay lodging in New York City through Airbnb and other home-sharing sites.

Airbnb said it will contest the law in a lawsuit.

Cuomo and sponsors of the bill, which passed in the Legislature earlier this year, said state law already prohibits the short-term leasing of many, but not all, permanent residences such as apartments and condominiums. A 2010 law bans so-called home sharing in multifamily units in New York City for periods of less than 30 days if the legal tenant isn’t at home.

Opponents said the online system could lead to transients living in apartments while providers of the service says it provides a low-cost option to travelers and cash for tenants.

“This is an issue that was given careful, deliberate consideration, but ultimately these activities are already expressly prohibited by law,” said Cuomo spokesman Rich Azzopardi. “They also compromise efforts to maintain and promote affordable housing by allowing those units to be used as unregulated hotels, and deny communities significant revenue from uncollected taxes, the cost of which is ultimately borne by local taxpayers.”

Fines for illegal ads of lodging and rooms can be $7,500.

Airbnb said it would sue to overturn the measure, which was strongly supported by the hotel industry and unions representing their workers.

“In typical fashion, Albany back-room dealing rewarded a special interest — the price-gouging hotel industry — and ignored the voices of tens of thousands of New Yorkers,” said Josh Meltzer, head of New York Public Policy for Airbnb. “A majority of New Yorkers have embraced home sharing, and we will continue to fight for a smart policy solution that works for the people, not the powerful.”

New York’s action was one of the most aggressive Airbnb has faced.

State Attorney General Eric T. Schneiderman said he will defend against a lawsuit.

“Airbnb can’t have it both ways: it must either police illegal activity on its own site — or government will act to protect New Yorkers, as the state just did,” Schneiderman said.

The hotel industry said the service undercuts their room prices and creates unfair competition.

Mario Cilento of the New York State AFL-CIO labor organization said the law will protect the jobs of 32,000 hotel workers.

“This law not only protects the jobs of hotel industry workers, it will help safeguard the supply of affordable housing units,” Cilento said.

Bus crash update … State seeks emergency 'caretaker' at LI nursing home … Honoring pets Credit: Newsday/NewsdayTV

Updated 5 minutes ago LI mother acquited of attempted murder ... Bus crash update ... Heuermann in court ... New piercing bar 

Newsday LogoCovering LI news as it happensDigital AccessOnly 25¢for 5 months