(Dado Ruvic/Reuters/Illustration)

Facebook will stop letting marketers run housing, employment, and credit ads that target or exclude users by racial and ethnic identity on the social network, the company announced Friday.

Facebook have let advertisers target ads using what it calls “ethnic affinity” for some time, but the practice came under fire after a recent ProPublica report showed how the feature could be used to place ads that may violate federal anti-discrimination laws.

The journalism outfit said it was able to order a Facebook ad for a housing event that wouldn’t be shown to African American, Hispanic and Asian American users. ProPublica was able to place the ad despite a Facebook policy banning marketers from using its ad targeting tools to discriminate against users.

The report led to an outcry from civil right groups and policymakers concerned that the targeting feature could be used to violate federal laws barring discriminatory ads in areas such as housing and employment opportunities.

Both the marketer and the publisher of a discriminatory housing ad can be punished under the federal Fair Housing Act, according to University of Missouri law professor Rigel Oliveri.

Sites that let people post ads are generally protected from that liability because of a different law that says such services aren’t responsible for user-generated content, she said. But Facebook’s approach raised “serious legal problems” because it offered tools that could be used to exclude a protected user class, according to Oliveri.

A group of users filed a potential class-action lawsuit against Facebook about the issue last week. 

Facebook told ProPublica it does not know users’ races and that the ethnic affinity categorization is determined by what posts and pages people engage with on the platform.

“Discriminatory advertising has no place on Facebook,” Erin Egan, Facebook's vice president for U.S. public policy and chief privacy officer, said in a Friday blog post.

The company will build tools to detect and automatically disable the use of “ethnic affinity” targeting for advertisements about housing, credit or employment, she wrote. There are “many non-discriminatory uses” for targeting ads in those areas using the company’s “ethnic affinity solution,” but the company decided the best way to “guard against discrimination” was suspending those types of ads altogether, Egan said.

Facebook spokeswoman Jodi Seth said the decision was “unrelated” to the pending lawsuit. Instead, it was a change the company had been considering and was “accelerated” after it heard from civil rights groups and policymakers, she told The Washington Post in an email.

In addition to blocking the advertisements, Facebook will update its advertising policies “to be even more explicit and require advertisers” to commit to not posting discriminatory ads on Facebook, Egan wrote. The company will also offer new educational materials aimed at explaining legal restrictions on housing, credit, and employment ads to marketers, she added.

The Center for Democracy & Technology, which had urged Facebook to change its system, praised the move.

“These changes will improve Facebook’s platform and protect its users from the worst types of discriminatory advertising,” CDT senior policy analyst Alethea Lange said in a blog post responding to the announcement.