Facebook is settling five lawsuits alleging that its advertising systems enabled discrimination in housing, credit and employment ads.

That clears one big legal issue for the social network but leaves others, including government investigations in the U.S. and Europe over its data and privacy practices.

Plaintiffs in the cases include the American Civil Liberties Union, the National Fair Housing Alliance and others.

FILE- In this May 18, 2012, file photo a television photographer shoots the sign outside of Facebook headquarters in Menlo Park, Calif. (AP Photo/Paul Sakuma, File)
FILE- In this May 18, 2012, file photo a television photographer shoots the sign outside of Facebook headquarters in Menlo Park, Calif. (AP Photo/Paul Sakuma, File)

Facebook says it will overhaul ad targeting for housing, credit and employment ads so they can’t be used to discriminate on the basis of race, gender, race and ethnicity, national origin, sexual orientation and other legally protected categories in the U.S.

The social media company is also paying about $5 million to cover legal fees and other costs.