A proposal to outlaw online advertisements for short-term New York City apartment rentals on sites like Airbnb has cleared the state Legislature.

It's already illegal to rent out apartments for less than 30 days in the city.

The measure heading to Democratic Gov. Andrew Cuomo's desk would establish graduated fines of up to $7,500 for advertising online or elsewhere for short-term rentals, which have expanded with online platforms.

"Airbnb has created a black market for illegal hotel operators," said Assemblywoman Linda Rosenthal, a Manhattan Democrat and bill sponsor. The practice reduces affordable housing for city residents, she said.

Josh Meltzer, Airbnb head of public policy, said lawmakers "cut a last-minute deal with the hotel industry" to pass the bill. He called it "a bad proposal that will make it harder for thousands of New Yorkers to pay the bills."

The civil penalties range from up to $1,000 for a first offense, $5,000 for the second and $7,500 for the third.

Existing law prohibits owners or renters of apartments in multiunit buildings from renting them for less than 30 days unless they remain present. It permits having boarders or renting rooms.

Airbnb's analysis shows some 24,400 city hosts have made rentals. That helps them pay rising rents and keep their homes, and many would be unable to pay the fines, Meltzer said.

"This is a bad bill driven by the hotel industry that will actually exacerbate the affordable-housing crisis, achieving the complete opposite of what its drivers claim it's intended to do," said Airbnb spokesman Peter Schottenfels.

State Attorney General Eric Schneiderman, who investigated Airbnb rentals from 2010 to 2014, called the bill's passage "a positive step" needed if Airbnb can't police itself. His office found 72 percent of the units in the city were illegal, with commercial operators constituting 6 percent of the hosts and supplying 36 percent of the rentals, he said.

Airbnb said in late 2014 that it had removed more than 2,000 of the New York listings that violated state or city laws.

Sen. Andrew Lanza, a Staten Island Republican and bill sponsor, said it's aimed at those who run illegal hotels in residential areas and doesn't target homeowners or interfere with property rights.

It's under review by the governor's counsel, one of 554 bills passed this year, spokesman Richard Azzopardi said Monday. It passed both houses Friday, shortly before state lawmakers ended their 2016 session.