Facebook Inc on Friday said it would stop advertisers from using its ethnicity-based ad-targeting feature on some ads, following criticism that advertisers could misuse the tool.

The feature, intended to help advertisers reach ethnic groups with relevant ads, has come under fire from politicians and civil rights leaders for allowing advertisers to exclude users from seeing ads based on their race.

“Facebook will disable use of the tool, called ‘Ethnic Affinities’, for ads that offer housing, employment and the extension of credit ─ areas where certain ethnicities have historically faced discrimination,” said the social network in a blog post.

“There are many non-discriminatory uses of our ethnic affinity solution in these areas, but we have decided that we can best guard against discrimination by suspending these types of ads,” wrote Facebook's Chief Privacy Officer Erin Egan.

“Facebook's advertising policy will now require a commitment from advertisers that they will not engage in discriminatory advertising on its platform.”

ProPublica, a non-profit news organisation, reported last month that Facebook lets advertisers exclude users by race, possibly violating federal housing and civil rights laws.

Facebook also indicated that it would provide material to educate advertisers about advertising related to housing, employment and credit.