SACRAMENTO (KCBS) – Legislation that would help curtail the number of Ellis Act evictions in San Francisco has passed the Senate with a 21-13 vote, this after failing to get the necessary votes on Wednesday in Sacramento.

After Senate Bill 1439 failed to pass, the author, state Senator Mark Leno (D-San Francisco) agreed to make changes to differentiate between family owners and big business interests.

READ MORE: Despite Short-Term Drop in Vaccine Supply, State Officials Predict Full Reopening by Summer

SB 1439 closes a loophole in the Ellis Act that allows speculators to buy rent-controlled buildings in San Francisco and immediately begin the process of evicting renters. The legislation would allow the city to require that landlords own a property for five years before attempting any mass evictions.

The bill is supported by San Francisco Mayor Ed Lee, along with a large group of tech companies, from Salesforce to Twitter, Zynga and Yelp.

READ MORE: San Francisco Nightlife Rebounds as Pandemic Restrictions Ease

“Today’s vote is a significant victory for San Francisco, which is facing an affordable housing crisis,” Leno said in a statement. “The Ellis Act was intended to apply to landlords who want to go out of the rental business, but it is now being abused by speculators who quickly vacate properties and resell them for a profit. Many of the displaced tenants are seniors, disabled people and low-income families with deep roots in their communities and no other local affordable housing options available to them. Our bill gives San Francisco an opportunity to stop the bleeding and save the unique fabric of our City.”

San Francisco Board of Supervisors President David Chiu, who is one of the leading supporters of Leno’s legislation, called it a good day for San Francisco.

“I’m very excited and it’s a great moment for helping San Francisco address the affordability crisis we’re in the midst of,” Chiu said. “We have too many San Franciscans who have been victims of Ellis Act [evictions] and this is a reform bill to really attack the real estate speculation, that has been evicting too many San Franciscans from their homes.

MORE NEWS: U.S. Supreme Court Orders California to Lift Pandemic Restrictions on Home Worship

SB 1439 will be heard in the Assembly this summer.