(Reuters) - The Trump administration accused Facebook Inc on Thursday of selling targeted advertising that discriminated on the basis of race, in violation of the U.S. Fair Housing Act.

Seeking damages and unspecified relief for harm caused, the U.S. Department of Housing and Urban Development said here in its civil charge that Facebook also restricted who could see housing-related ads based on national origin, religion, familial status, sex and disability.

Facebook said it had been working with the department to address the concerns and was surprised by the decision to issue the charge, having taken “significant steps” to prevent ads that discriminate across its platforms.

The company also said the government had “insisted on access to sensitive information - like user data - without adequate safeguards,” adding that it was willing to provide aggregate reports but not user-level personal information.

The Housing Department claims Facebook mines data about its users and then employs machine learning to predict their responses to ads in ways that may recreate groupings defined by characteristics such as race.

A spokesman for the department declined to comment on the details of the discussions.

The social media giant last week agreed to overhaul its paid advertising platform as part of a wide-ranging settlement with U.S. civil rights groups, which had filed five separate lawsuits accusing the company of enabling discrimination in advertising.

Under U.S. law, including the federal Fair Housing Act, it is illegal to publish certain types of ads - including online ads - if they indicate a preference based on race, religion, sex or other specified classifications.

As part of last week’s settlement, Facebook said it would create a new advertising portal for ads linked to housing and employment that would limit targeting options for advertisers. It also pledged to build a tool that would allow users to search all current housing ads listed in the United States, regardless of whether the ads were directed at them.

The government charge said Facebook enabled advertisers to exclude people whom the social network’s data classified as parents, non-American-born, non-Christian, or a variety of other interests that closely align with the Fair Housing Act’s protected classes.

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

The Facebook logo is reflected on a woman's glasses in this photo illustration taken June 3, 2018. REUTERS/Regis Duvignau/Illustration

GROWING DISCONTENT

The Housing Department has also requested information about ad targeting from Twitter and Google, Facebook’s main competition for online advertising dollars, but has not launched an investigation into either company, the spokesman said.

Both Twitter and Google denied allowing discriminatory advertising, although they said that they do allow advertisers to target by gender.

Researchers have told Reuters that gender targeting could potentially be a violation of the Fair Housing Act.

Discrimination against transgender individuals was prohibited, Google said.

“We’ve had policies in place for many years that prohibit targeting ads on the basis of sensitive categories,” Google said in a statement.

Advertising practices at Facebook, the world’s largest social network with 2.7 billion users and $56 billion in annual revenue, have been in the spotlight for two years amid growing discontent over its approach to privacy and user data.

News organization ProPublica reported as far back as 2016 that advertisers could target ads through Facebook based on people’s self-reported jobs, even if the job was “Jew hater.”

ProPublica later reported that it was able to buy discriminatory housing ads and slip them past Facebook’s review process, despite the company’s claims it was blocking such ads.

Since then, Facebook has faced legal pressure over the issue from the National Fair Housing Alliance, the American Civil Liberties Union (ACLU) and the Communications Workers of America, among others.

The ACLU welcomed the complaint, saying it would add “much-needed pressure” on the company on top of last week’s settlement. It encouraged the department to investigate other online ad targeting platforms.

“Although the settlement we reached with Facebook will result in removing many of the most troubling of Facebook’s advertising practices, there is more work to be done,” Galen Sherwin, an ACLU attorney, said in a statement.

The charge will be heard by a judge who can award damages for harm caused by the discrimination, along with fines, injunctions and other relief.