A man poses with a magnifier in front of a Facebook logo on display in this illustration taken in Sarajevo, Bosnia and Herzegovina, Dec. 16, 2015. REUTERS/Dado Ruvic

Facebook has bowed down to pressure from lawmakers and civil rights groups and announced that it will stop its so-called “ethnic affinity marketing” for some advertisements, so that it can better prevent discrimination on the social network. The company's policies already ban discriminatory ad content.

Until the announcement, Facebook allowed advertisers to use “ethnic affinity” and other parameters such as gender, age, favorite movies, food preferences and geography to determine user-targeted ads.

"Recently, policymakers and civil rights leaders have expressed concerns that advertisers could misuse some aspects of our affinity marketing segments. Specifically, they’ve raised the possibility that some advertisers might use these segments to run ads that discriminate against people, particularly in areas where certain groups have historically faced discrimination — housing, employment and the extension of credit," Erin Egan, Facebook's vice president on U.S. public policy and chief privacy officer, said in an official blog post Friday.

The company added that it would work on measures to detect and automatically disable ethnic affinity marketing for ads offering housing, employment or credit.

In fact, the social media giant does not allow people to mark their race on their profile. However, for marketing purposes, it allowed advertisers to target different ethnicities such as Asian-American, African-American and several Hispanic groups.

Market research company eMarketer forecasted in April that Facebook’s global ad revenue is expected to clock in at $25.9 billion in 2016.