An ordinance that would add new regulations for short-term rental housing on Airbnb and other vacation rental websites was approved Tuesday by the Los Angeles City Council.

The ordinance would limit short-term rentals to people renting out their primary residence for vacation rentals and prohibit apartment conversions into what some have called “rogue hotels.” The regulation defines a primary residence as one where the host lives onsite for at least six months.

“We have lost thousands and thousands of units,” said City Councilman Paul Koretz. “We have contributed to homelessness. We’ve contributed to the higher prices that make the city so unaffordable, and we have to take action today to change this.”

Yet Airbnb was critical of the move, insisting a more comprehensive policy was needed by the city to avoid “bad actors” from skirting the rules.

The measure would allow homeowners with a good record as a short-term rental host to petition to go above a cap of 120 days. However, the city could deny the right to rent year-round to hosts who have nuisance violations.

Passage of the ordinance follows three years of debate on regulations involving Airbnb, which in 2016 struck a three-year deal with the city of Los Angeles to pay hotel taxes on behalf of hosts. The company’s hosts have been responsible for more than $100 million in transient occupancy tax collections for California’s largest city since August 2016.

“There are definitely studies that have linked the relationship between rising rents and the size of the short-term rental market” said Gary Painter, director of the USC Sol Price Center for Social Innovation.

The ordinance, approved unanimously by the council, is set to take effect July 1, 2019, although that date could be delayed to later when the city is expected to take up an ordinance regulating nonprimary residences.

“This doesn’t satisfy anybody 100 percent,” said City Councilman Mike Bonin, one of the sponsors of the measure. “But this comes about as close as this body can come after years of work to striking a balance between those interests.”

The ordinance requires short-term rental property hosts to obtain registration numbers from the city in order to advertise units for rent on Airbnb and other platforms. Units that are allowed to be rented and meet the city’s criteria would get be eligible for the registration numbers.

Hosts without registration would be considered in violation of the city ordinance. The measure also requires services such as Airbnb and HomeAway to keep track of the number of days a host has rented properties and makes the vacation rental websites subject to penalties of $1,000 daily for violations.

“Homesharing and vacation rentals play an important role in allowing Angelenos to directly benefit from 48 million visitors who travel to Los Angeles every year,” said Mattie Zazueta, a spokesperson for San Francisco-based Airbnb. “The city needs a comprehensive short-term rental policy that regulates all short-term rental activity, including its long standing vacation rental market.”

Zazueta added that without such a policy, the city of Los Angeles “will create a loophole that allows bad actors to jump from platform to platform in an attempt to evade the rules. We believe we can work with the city to enact the rules that preserve the economic benefits of short-term rentals for residents, while minimizing concerns regarding housing affordability.”

A recent report about vacation rentals and Airbnb shows there were 1.5 million housing units in LA in 2017 and nearly 13,600 of them listed as vacation rentals. That represents about 0.9 percent of the city’s total housing stock.

Airbnb, meantime, had listings last year for nearly 0.3 percent of the city’s housing stock, or fewer than 3,000 full-time rentals.

The ordinance allows accessory dwelling units, or so-called granny flats, permitted prior to Jan. 1 of last year or later to be exempted. City officials estimated there have been thousands of the accessory dwelling units built since that time due to eased state rules that allow more backyard home units to ease the state’s housing shortage.

At the same time, it bars short-term rentals of units that fall under the city’s Rent Stabilization Ordinance. There are about 631,000 units in 118,000 properties in the city that fall under this ordinance, including apartments and condominiums, according to the city’s Housing and Community Investment Department.

Bonin, the city councilman, said the ordinance will likely need to be reviewed after six months or a year to determine “where it works and where it’s weak.” Indeed, one of the changes could be to allow some low-income residents in the rent-stabilized units to become hosts for short-term rentals.

According to Bonin, the council could eventually “tweak and revise it to adjust to the reality on the ground to make sure what we’re passing today does its intended job of protecting rental housing and preserving our neighborhoods.” He also said it was important to allow “people who are genuinely trying to use their personal property, their primary residence, to make ends meet.”

It remains to be seen how well the city can enforce the regulation of short-term rentals.

`The key to this has been enforceability,” Bonin conceded. “The city, I’m the first to admit, does not have a great track record in enforcing a lot of the legislation that we approve.”