The Department of Housing and Urban Development announced Thursday that it had charged Facebook with housing discrimination, alleging that the social media giant allowed housing ads that filter out minorities and other protected groups.

“Facebook is discriminating against people based upon who they are and where they live,” said HUD Secretary Ben Carson. “Using a computer to limit a person’s housing choices can be just as discriminatory as slamming a door in someone’s face.”

The agency had been investigating Facebook for possible violations of fair housing laws since the summer.

HUD's complaint said that Facebook allowed advertisers to avoid parents, immigrants, non-Christians, and Hispanics. It also alleged that it allowed advertisers to exclude potential renters or buyers in certain neighborhoods, effectively "redlining" them in the same way that mortgage lenders used to discriminate against minority neighborhoods.

Facebook had announced changes to its ad platform to avoid discrimination earlier this month.

[Also read: Facebook bans white nationalist speech]