New York (CNN Business) The Department of Housing and Urban Development is charging Facebook with violating the Fair Housing Act.

HUD on Thursday said the social media giant is violating the federal act by "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. "Using a computer to limit a person's housing choices can be just as discriminatory as slamming a door in someone's face."

Last August, HUD filed a formal complaint against Facebook , claiming the company allows landlords and people selling homes to use its advertising platform to "engage in housing discrimination." The complaint said advertisers can dictate who sees housing-related ads based on race, religion, sex, disability and other characteristics.

Facebook FB Just last week,said it would pay about $5 million to settle several lawsuits that alleged its advertising platform allowed for discrimination in housing, employment and credit ads. It also announced several steps to address the issue, including a separate advertising portal for housing, employment and credit ads that offers significantly less targeting options, and a new page where US users can search for and view current housing-related ads even if they didn't appear on their News Feed.

Read More