Rent-controlled units in Los Angeles will be banned from Airbnb and other short-term rental platforms under regulations adopted Tuesday by the City Council.

The rules adopted unanimously Tuesday come after more than three years of deliberation and will take effect in July, applying to the entire city of Los Angeles, including vacation hotspots such as Venice.

They are the city’s first attempt to legalize and simultaneously crack down on short-term rentals, which critics say are creating conflicts in neighborhoods and worsening the housing crisis.

Under the rules, which need to be signed into law by the mayor, hosts will only be allowed to rent out their primary residences, defined as the place where a host lives for more than six months of the year.

Hosts will also be limited to renting their residences for 120 days per year—unless they get special approval from the city and pay extra fees—and they will have to register with the city at the cost of $89 per year. Temporary and “non-residential” structures—including tents, trailers, and RVs—are also banned.

Los Angeles City Councilmember Mike Bonin says the regulations strike a balance between accommodating hosts who share their homes “to make their ends meet” and punishing “bad” hosts who turn apartments and homes into “rogue hotels.”

Because it’s far more lucrative for property owners to rent to vacationers than to long-term tenants, city officials and critics have argued that short-term rental platforms such as Airbnb are taking sorely-needed rental units off the market.

Of the approximately 23,000 homes and units available for rent in Los Angeles on short-term rental platforms, as many as 10,000 are used primarily for short-term rentals, according to Host Compliance LLC, a company that monitors short-term rental platforms.

“With Los Angeles facing a housing crisis and growing homeless population, the trend of commercial Airbnb investors taking homes away from permanent residents has got to end,” Cynthia Strathmann, executive director of Strategic Actions for a Just Economy, a nonprofit in South Los Angeles, said in a statement. “The action by the LA city council today is a major step forward in addressing this growing problem.”

But many Airbnb hosts have testified at City Hall that the platform has helped them pay their mortgages, keeping them in their homes as housing costs skyrocket.

Rhonda Hayder told the council that she rents out the upper unit in her rent-stabilized Miracle Mile duplex while living in the lower unit, and the income has helped her stay afloat financially after she was downsized from her job.

“LA is becoming increasingly unaffordable... we need it to survive,” she said of Airbnb. “Preventing me from renting [out] my own home will not put [rent-stabilized] units back on the market.”

Airbnb’s public policy director John Choi called the new regulations “a big step in the right direction.” The company is advocating for Los Angeles city officials to craft a separate ordinance that would regulate vacation rentals, or units that are not a host’s primary residence.

City Councilmembers Herb Wesson and Councilman Marqueece Harris-Dawson introduced a motion Tuesday that would do that. The proposal, which needs to be vetted by the council’s planning and land use management committee, calls for a permitting system and registration process for vacation rentals that could include capping the number of vacation rentals citywide.

Under the short-term rental rules adopted Tuesday: