The Department of Housing and Urban Development has rejected San Francisco’s neighborhood housing preference plan, which will have an immediate impact on the city’s attempt to use policy to stem the exodus of African Americans and members of other minority groups from neighborhoods that are rapidly gentrifying.

In a letter to Olson Lee, who heads up the city’s Office of Housing and Community Development, Gustavo Velasquez, HUD’s assistant secretary for fair housing and equal opportunity, said San Francisco’s plan could “limit equal access to housing and perpetuate segregation” in violation of the 1968 Fair Housing Act.

The San Francisco Board of Supervisors passed the neighborhood preference plan in December after months of debate on how to craft a law that would ensure new affordable housing units would be available to current neighborhood residents.

The plan seeks to set aside 40 percent of all new subsidized units for qualified people already living in the supervisorial district in which the development is being built or within a half mile of the project.

In particular, supporters of the plan hoped it would help African Americans improve their odds in lotteries used to fill most below-market units in market-rate developments and 100 percent subsidized projects. Just 4.7 percent of privately developed subsidized units created between 2008 and 2014 went to African Americans. The city’s African American population has plummeted from 13.7 percent of the city’s population in 1970 to 5.7 percent today.

The HUD decision will have an immediate impact on how residents are selected for the Willie B. Kennedy development at Turk and Webster streets in the Western Addition, a 98-unit senior housing development set to open this fall, because neighborhood residents will no longer receive better odds in the lottery.

The project, being built by the Tenderloin Neighborhood Development Corp., was financed with $15.2 million from HUD. The federal agency will also provide rent subsidies to residents, who will pay 30 percent of their income in rent, money that could be in jeopardy if the city were to defy the federal government and stick to the neighborhood preference plan.

Board of Supervisors President London Breed, a Western Addition native who grew up in public housing, called the HUD decision “devastating.” Breed said she has been working with older constituents who were optimistic that the neighborhood preference would give them a better chance to get homes in the new building.

“This is more than a huge disappointment,” Breed said. “These are seniors sleeping on friends’ couches, staying with their kids, living in (residential) hotels. This community has been falsely promised so much. With the neighborhood preference they thought they would have a real shot.”

The question of what the HUD decision means for other projects is uncertain, according to city officials. As the federal government has cut investment in affordable housing in recent decades, the burden of building below-market-rate homes has increasingly fallen on state and local governments. The Kennedy project was the last San Francisco development to receive money from Section 202, an affordable housing program for seniors eliminated in 2012.

While HUD doesn’t have a say in approving the marketing plan of projects it doesn’t directly fund, the agency is also responsible for upholding the Fair Housing Act. In that role, HUD could seek to block the city from using the neighborhood preference program in private and city-subsidized developments that do not receive federal funding. The state could also follow HUD’s lead and refuse to fund projects that use neighborhood preferences.

Knowing that HUD would be scrutinizing the program, the city spent months trying to convince federal officials that the neighborhood preference plan was consistent with fair housing law, said Jeff Buckley, who advises Mayor Ed Lee on housing issues. The city offered to modify the program to reduce the set-aside percentage and agreed to treat the Kennedy development as a pilot program subject to HUD review and scrutiny.

In a letter to HUD, Olson Lee said the program’s goal is to “provide existing residents the choice to stay within their communities when market rents rise rapidly.”

Deirdre Hussey, a spokeswoman for the mayor, said he “urges HUD to reconsider their objections to San Francisco's neighborhood preference program and allow us to prioritize keeping people in the neighborhoods where they have built a life and have strong community connections.”

The controversy puts some San Francisco affordable housing advocates in the uncomfortable spot of fighting the very fair housing laws that were put in place to help minorities secure homes in neighborhoods looking to keep them out.

“We always knew we were swimming against the national stream,” Buckley said. HUD “sees neighborhood preference as a tool of exclusion, but San Francisco is using it as a tool of inclusion, to help people in the neighborhoods at a time when there are great concerns about displacement.”

The Rev. Amos Brown, a minister at the Third Baptist Church and president of the San Francisco chapter of the NAACP, called the HUD ruling an “egregious injustice against African Americans in this city.”

“The law is working against us,” he said. “Here we came up with a measure that would have allowed us to right some wrongs and (HUD) says ‘no’ when they haven’t even been here to see the real pain and insults that have been perpetrated against black people.”

On Thursday the the Tenderloin Neighborhood Development Corp. plans to start marketing the 98 units at the Kennedy project, a development that is likely to receive thousands of applications. Don Falk, the organization’s executive director, said they hedged their bets, developing one marketing plan that included the neighborhood preference, and one that did not.

“I had hoped that HUD would approve this as a pilot so that we would have opportunity to show it could be done in a way that would comply with fair housing law,” Falk said. “The loss of the African American community from San Francisco is reprehensible, and we can’t be complacent about that.”

San Francisco officials are scheduled to talk to HUD officials later this week about the decision. In his letter, HUD’s Velasquez said the agency hopes “to be a partner in helping the city address these challenges.”

“The Department recognizes the significant affordable housing challenges San Francisco faces,” he said. “We are optimistic that anti-displacement strategies can be designed to be consistent with fair housing law and policy.”

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com

Twitter: @sfjkdineen