The Department of Housing and Urban Development proposed a new rule Friday to make people seeking housing assistance have to prove their legal status, in a move that could oust thousands of illegal immigrants.

Secretary Ben Carson said the rule would bring policy into compliance with the law, which generally tries to restrict public benefits to citizens and legal residents.

“There is an affordable housing crisis in this country, and we need to make certain our scarce public resources help those who are legally entitled to it,” Mr. Carson said.

When the Washington Times broke the news of the rule last month, officials said it could apply to perhaps 32,000 families who have an illegal immigrant head of household claiming taxpayer-funded assistance.

The new rules would require new applicants to have their information run through the federal SAVE database, which is used to weed illegal immigrants out of other public benefits. Families already in housing would have to be newly checked over the course of time.

Legal immigrants, refugees and asylees would not be ousted.

Illegal immigrant-led families who claim a hardship could earn an 18-month reprieve under the rule.

Still, immigrant-rights groups were incensed, calling the move an “attack” and warning of a rise in homelessness in illegal immigrant-led families.

“By stripping this basic need from families, it’s clear this administration is intent on using every avenue to stigmatize and destabilize immigrant communities,” said the New York Immigration Coalition.

Activists acknowledged the 1 million-person backlog of people awaiting housing assistance right now but said the 32,000 spots opened up by ousting illegal immigrant-led households won’t make enough of a difference to justify the upheaval.

They said the households where illegal immigrants are getting assistance are usually mixed families, where some people are legal residents.

The Center on Budget and Policy Priorities said in those cases, the amount of assistance is prorated so the illegal immigrant residents — or those who refuse to admit their status — aren’t covered by taxpayer money.

“The administration’s proposal would abandon this sensible approach, which both Republican and Democratic administrations have followed for more than two decades,” said Robert Greenstein, president of CBPP.

He said the result of the policy could be to force some families to separate, or else leave them without assistance altogether.

The rule gives the public 60 days to comment.