Facebook violates the Fair Housing Act by allowing landlords and home sellers to use its advertising platform to engage in housing discrimination, the U.S. Department of Housing and Urban Development said in a formal complaint filed Friday.

HUD alleges that Facebook allows advertisers to control which users receive housing-related ads and express unlawful preferences by offering discriminatory options, allowing them in effective to limit housing options for protected classes under the guise of “targeted advertising.” HUD’s complaint alleges, for example, that Facebook enables advertisers to, among other things, not show ads to Facebook users who have expressed an interest in a “mobility scooter” or in “accessibility.”

“When Facebook uses the vast amount of personal data it collects to help advertisers to discriminate, it’s the same as slamming the door in someone’s face,” HUD Assistant Secretary for Fair Housing and Equal Opportunity Anna María Farías said.

A LeadingAge spokesperson told McKnight’s Senior Living: “LeadingAge and our members fully support the Fair Housing Act and are as concerned as HUD that Facebook’s online platforms may not allow all households to see housing advertisements equally.”

HUD’s secretary-initiated complaint will result in a formal fact-finding investigation. Facebook will have the opportunity to respond. If a charge of discrimination is filed, then Facebook could resolve it through a settlement through referral to the Department of Justice or through an administrative determination.

In a comment shared by CNBC, Facebook said: “There is no place for discrimination on Facebook; it’s strictly prohibited in our policies. Over the past year, we’ve strengthened our systems to further protect against misuse. …We’re aware of the statement of interest filed and will respond in court, and we’ll continue working directly with HUD to address their concerns.”

Meanwhile, also on Friday, a federal judge threw out a lawsuit that affordable housing advocates had brought against HUD Secretary Ben Carson. The plaintiffs had challenged how HUD enforces fair housing laws via the Affirmatively Furthering Fair Housing rule.

In May, Carson had withdrawn a computer assessment tool that allowed the agency to oversee whether communities complied with the law.

In a statement to the Washington Post, HUD said it is “deeply committed to the Fair Housing Act and will continue to live up to the spirit and the letter of the law.”