Facebook has previously faced lawsuits from housing groups after ProPublica reported in 2016 that advertisements for rental homes were targeting ads based on an "affinity" for demographics like African-American, Asian-American or Hispanic or excluding people interested in terms that could be associated with protected groups.

HUD's complaint specifically says that as of July 2018, Facebook's ad targeting tools allowed advertisers to show ads only to men or women, not show ads to users interested in terms associated with persons with disabilities, religions, having children, or even other countries.

HUD also said that Facebook allowed advertisers to discriminate by race by "drawing a red line around majority-minority zip codes and not showing ads to users who live in those zip codes," according to the complaint.

“The Fair Housing Act prohibits housing discrimination including those who might limit or deny housing options with a click of a mouse,” said Anna María Farías, HUD’s Assistant Secretary for Fair Housing and Equal Opportunity. “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.”

Facebook has previously said that it would address advertising options that allowed advertisers to target these groups and said the company would fight lawsuits alleging it allowed discrimination.

In addition to the complaint filed by HUD. the U.S. Attorney for the Southern District of New York filed a statement challenging Facebook's advertising platform. HUD's complaint is the result of an investigation and will lead to a formal fact-finding investigation. If the department finds reasonable cause that Facebook violated the Fair Housing Act they could refer a discrimination charge to the Justice Department.

A Facebook spokesman said they will work with HUD to respond to their concerns.

"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," the spokesperson told ABC News in a statement.