Residents from the Mission District and other areas heavily impacted by gentrification will get preferential access to some of San Francisco’s affordable housing stock, a federal agency has decided.

The Department of Housing and Urban Development decided on Wednesday that it would allow for an “anti-displacement” preference in the Willie B. Kennedy complex, a 98-unit senior housing complex recently completed in the Western Addition.

The city will use the lottery at the Willie B. Kennedy complex as a pilot program before deciding whether to expand the anti-displacement preference city-wide, according to Jeff Buckley, a senior housing advisor to Mayor Ed Lee.

“We think it’s going to be an effective tool to keep our African American and Latino households, and other at-risk populations, within the city, including within the Mission,” he said.

The federal ruling allows for 40 percent of the project’s units for residents of census tracts that have been heavily impacted by “advanced gentrification” or are “undergoing displacement,” as defined by the Urban Displacement Project from the University of California, Berkeley.

The Mission District is the neighborhood with the most affected tracts, and its residents would be among those to get preferential access to the Willie B. Kennedy complex.

If the pilot program is successful and the city decides to expand it to other fully affordable housing programs, residents of the affected tracts would get preference to hundreds of below-market-rate units coming to the Mission District in the next few years.

“This gives the Mission District and its affordable housing developers the opportunity to ensure that at least a significant portion — 40 percent — of the units can have preferences for those who grew up in and around their community,” said Sam Moss, the executive director of Mission Housing, which is developing a 157-unit fully affordable complex at 1950 Mission St.

The federal housing department is still opposed to the city’s “neighborhood preference” law, which would have reserved 40 percent of units for those living within the same district as a project or a half-mile around it.

The department said the law violated the 1968 Federal Housing Act and could have promoted racial segregation in housing. That objection meant the department could have pulled federal funding from projects in the city.

Instead, the department said San Francisco could proceed with a preference targeted specifically at census tracts that are experiencing rapid displacement or gentrification.

The Mission District has the most affected census tracts, but other affected neighborhoods include the Tenderloin, the Western Addition, the Bayview-Hunter’s Point, and South of Market.

Residents from the Mission District would not get a preference over other residents from affected areas. Rather, 40 percent of the units in new fully affordable housing projects would be distributed in a separate lottery for qualified applicants hailing from all gentrified neighborhoods.

That move, Buckley said, would improve certain applicants’ chances but was not a panacea for those seeking to enter a subsidized unit in San Francisco. At the Willie B. Kennedy project, for example, Buckley said there were 5,000 applications for 98 spots.

“We always want to temper people’s expectations, because it’s really a numbers game where you have to keep applying,” he said. “There’s a need out there for more affordable housing.”

Affordable housing projects that do not use federal funds will still use the neighborhood preference law originally passed by the city.

The decision from the federal housing department comes after weeks of intense negotiation with San Francisco city officials.

“It’s just a really good day,” said Supervisor London Breed, a key proponent of the preference. Breed flew to Washington, D.C. in late August after the federal housing department went against the city’s neighborhood preference measure, which the Board of Supervisors passed in 2015.

Breed, who grew up in public housing in the Western Addition, met with federal housing officials in the capital and impressed upon them the need to give disadvantaged minorities a better shot of staying in the city.

“I keep getting emotional today because I keep thinking of all the people who are really counting on this housing,” she said, tearing up. “What’s happening to the Mission community, what’s happening to the Bayview-Hunter’s Point community, what’s happening to the Western Addition — I don’t want to continue to see us move in the wrong direction.”

Black residents of San Francisco are under represented in affordable housing stock. They’ve won just 4.7 percent of all privately developed below-market-rate housing in the city between 2008 and 2014, less than any other group. Black people make up 5.7 percent of the city’s population, down more than half from 13.7 percent in 1970.

Latinos, too, have a difficult time winning subsidized housing. They inhabit just 11 percent of the private below-market-rate units in the city but make up 15.3 percent of the population.

The city’s economist reported last year that the Mission District would lose 35 percent of its Latino population by 2025 — from 48 percent in 2009–2013 to 31 percent in 2015 — if current trends continue.

Asians, meanwhile, reside in 46 percent of the city’s below-market-rate units despite being 35 percent of the overall population.

Breed said this was just one of many measures the city would need to take to put a dent in the city’s affordability crisis. City officials should look at under-utilized sites to build housing on parking lots and gas stations, she said, and also look to expand its middle income housing stock.

Still, she said, a preference to keep San Franciscans in San Francisco was a long-time coming.

“We can talk about building affordable housing, but at the end of the day there wasn’t a direct connection between the people that we know needed it in our community and actually getting access to what we build,” she said.

Now, she said, there is.

Federal Government Letter on Anti-Displacement Preference by MissionLocal on Scribd

Census Tracts for Anti-Displacement Preference by MissionLocal on Scribd