SAN FRANCISCO (KCBS)— San Francisco is setting aside $3 million from the city’s affordable housing pool to protect low-income residents from being displaced from their apartments.

Mayor Ed Lee announced details of the loan program that would help non-profit organizations buy apartment buildings where there’s a risk of its tenants being evicted through the Ellis Act. The idea is that a city-sponsored investor would obtain the property ahead of a housing speculator.

READ MORE: Liana Wallace On 'Survivor' All-Black Alliance Falling Apart: 'Just Wanted Us To Make Top 8, Then We Can Have World War II''

The Ellis Act is the state law that allows landlords to get out of the rental business by flipping or fixing up their property and then selling it to individual owners.

READ MORE: Man Wins $1 Million On Scratch-Off Lottery Ticket Gifted To Him After Heart Surgery

“Some of the people that are screaming for help and we hear them loud and clear. We’ll have some answers for them,” said Mayor Lee on Monday.

The program will target medium-sized buildings of five to 25 units and make loans available for acquisition and rehabilitation.

MORE NEWS: Tesla Officially Moves Headquarters From Palo Alto To Texas Gigafactory

“Perhaps there’s a stabilizing impact to potentially change the ownership of those buildings or help the current owner be able to afford it and stabilize it and keep it affordable for those residents,” said Lee.