The Department of Housing and Urban Development has accused social media platform Facebook of violating the Fair Housing Act.

The federal department alleges that Facebook has been "encouraging, enabling, and causing" housing discrimination through its advertising platform.

"Facebook is discriminating against people based upon who they are and where they live," HUD Secretary Ben Carson said in a statement per CNN.

 "Using a computer to limit a person's housing choices can be just as discriminatory as slamming a door in someone's face."

In the court documents, HUD accuses Facebook of unlawfully discriminating against people based on race, religion, familial status, disability and other characteristics that closely align with the 1968 Fair House Act's protected classes.

Facebook were reportedly blindsided by the lawsuit as they told the news outlet that they had been working with the HUD to improve things.

"Last year we eliminated thousands of targeting options that could potentially be misused, and just last week we reached historic agreements with the National Fair Housing Alliance, ACLU, and others that change the way housing, credit, and employment ads can be run on Facebook," a Facebook spokesperson told CNN Business.

A spokesperson also spoke to NPR, telling them:

"While we were eager to find a solution,. HUD insisted on access to sensitive information — like user data — without adequate safeguards. We're disappointed by today's developments, but we'll continue working with civil rights experts on these issues."

Facebook just announced last week that they would be settling several other lawsuits for just under $5 million with several groups including the National Fair Housing Alliance.