The federal government charged Facebook on Thursday with violating the Fair Housing Act by “encouraging, enabling and causing” housing discrimination in advertising on its platforms.

The charges by the Department of Housing and Urban Development come a week after the tech giant announced it would overhaul its ad-targeting systems to tackle discrimination in housing, credit and employment ads as part of a settlement with civil-rights groups.

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

In August 2018, Carson accused Facebook of enabling housing discrimination by allowing advertisers to exclude people based on race, color, national origin, religion, family status, gender and disability after a preliminary investigation that began during the Obama administration.

In its announcement, HUD “claims Facebook mines extensive data about its users and then uses those data to determine which of its users view housing-related ads based, in part, on these protected characteristics.”

The nature of the possible penalties was not immediately clear.

Facebook expressed surprise over the civil charges, saying it has been working with HUD to address its concerns and has taken steps to avoid discrimination, including eliminating thousands of targeting options that could be misused by advertisers.

“We’re disappointed by today’s developments, but we’ll continue working with civil rights experts on these issues,” the company said in a statement.

Facebook spokesman Joe Osborne told The Washington Post that a breakdown occurred when the feds asked for complete access to the company’s user base, a request it denied because it would have set a dangerous precedent.

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

Meanwhile, the newspaper cited three sources at HUD as saying the agency alerted Twitter and Google last year that it was reviewing their practices for potential housing discrimination.

A Twitter rep told the newspaper that the company’s policies prohibit targeted advertising when it comes to racial or ethnic origin, religion and negative financial condition. It declined further comment on HUD’s interest in the company.

Google did not respond to the paper’s requests for comment.