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.

Just last week, Facebook (FB) 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.

On Thursday, Facebook said it was “surprised” by HUD’s decision and noted the company had been working with the department to address its concerns. Facebook also said it has taken “significant steps” to prevent advertising discrimination.

“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.

“We’re disappointed by today’s developments, but we’ll continue working with civil rights experts on these issues,” the spokesperson added.

Facebook also said it was “eager” to find a solution, but said HUD “insisted on access to sensitive information” such as user data without proper safeguards.

The company has long faced criticism about its advertising platform and whether its systems allow for discrimination. In December 2017, a ProPublica and New York Times investigation found that dozens of major companies ran recruitment ads only for specific age groups. At the time, Facebook said age-based targeting is “an accepted industry practice.”

Another ProPublica report in November 2017 found discriminatory ads were making it through Facebook’s systems. ProPublica was able to purchase dozens of home-rental ads that specifically excluded “African Americans, mothers of high school kids, people interested in wheelchair ramps, Jews, expats from Argentina and Spanish speakers.”