Facebook has disabled so-called ethnic affinity filters from housing, credit and employment ads following mounting criticism that the practice allowed marketers to discriminate against minorities in violation of fair housing and civil rights laws.

"We are making these changes to deter discrimination and strengthen our ability to enforce our policies," Erin Egan, Facebook's chief privacy officer, said in a post on the social media company's blog Friday. "We look forward to finding additional ways to combat discrimination, while increasing opportunity."

The social media company's filters give marketers the option of targeting or avoiding consumers with certain attributes. One such attribute is an "ethnic affinity" with African-Americans, Asian-Americans or Hispanics.

Since this feature came to light in an article by ProPublica published on Oct. 28, Facebook had been criticized by members of Congress and civil rights groups claiming the option violated the Fair Housing Act. On Nov. 3, three users sued the social media site, alleging housing and employment discrimination because, they claimed, they were prevented from seeing certain ads because of their race or ethnicity.

Since then, Facebook has been meeting with New York Attorney General Eric Schneiderman, Rep. Robin Kelly, D-Ill., of the Congressional Black Caucus, and Rep. Linda Sanchez, D-Calif., of the Congressional Hispanic Caucus, and listened to their concerns, Egan said.

Among the civil rights groups Facebook had discussions with was the National Fair Housing Alliance.

The Fair Housing Act makes it "unlawful to make, print or publish … [an] advertisement with respect to the sale or rental of a dwelling that indicates any preference, limitation or discrimination because of race, color, religion, sex, handicap, familial status or national origin." The law applies to mortgage companies' marketing and advertising.

To demonstrate the filter's impact, ProPublica bought an ad on Facebook for a housing-related event and chose to exclude African-Americans, Asian-Americans and Hispanics from seeing the content while otherwise targeting those people looking to buy a home.

The article led to a letter signed by four members of the Congressional Black Caucus addressed to Facebook CEO Mark Zuckerberg inviting him to have "a constructive dialogue" about the ethnic affinity feature.

"While I don't believe that Facebook intentionally sought to promote housing discrimination, I do feel they now have a responsibility to right this wrong. Technology shouldn't be used to divide communities, and episodes like this are preventable," Rep. Kelly said in a press release accompanying the letter.

The letter was also signed by Congressional Black Caucus Committee Chairman Rep. G.K. Butterfield, D-N.C., Rep. Emanuel Cleaver, D-Mo., and Rep. Yvette Clarke, D-N.Y.

"By allowing advertisers to promote or market a community or home for the purpose of sale to select an 'ethnic affinity' as part of their advertising campaign, Facebook is complicit in promoting restrictive housing practices," the letter said.

The suit was filed in the U.S. District Court for the Northern District of California by plaintiffs Karen Savage of New York, Victor Onuoha of Gretna, La., and Suzan-Juliette Mobley of New Orleans. Besides Facebook, the suit named ad purchasers as defendants.

In their suit, the plaintiffs acknowledged the benefits of targeted marketing and were not looking to eliminate the exclude-people option, just its use in housing and employment ads.

A request to the plaintiffs' attorneys for an update on the suit's status was not returned by deadline.

Facebook has called the suit meritless. "Our policies prohibit using our targeting options to discriminate, and they require compliance with the law," the company said in an emailed statement after the case was filed.

In her blog post Friday, Egan said the recent changes were "designed to better enable us to enforce these policies."

There are "non-discriminatory uses" of ethnic affinity in ads for housing, credit and employment, she wrote. "But we have decided that we can best guard against discrimination by suspending these types of ads. We will continue to explore ways that our ethnic affinity solution can be used to promote inclusion of underrepresented communities, and we will continue to work with stakeholders toward that goal."