Facebook is overhauling its ad-targeting systems to tackle discrimination in housing, credit and employment ads, the tech giant announced Tuesday.

The move is part of a legal settlement with plaintiffs that include the American Civil Liberties Union, the National Fair Housing Alliance and the Communication Workers of America (CWA). Civil rights organizations have also voiced their concern about Facebook’s advertising methods.

The social network said it will no longer allow housing, employment or credit ads that target people by age, gender or zip code. Facebook will also limit other targeting options so these ads don't exclude people on the basis of race, ethnicity and other legally protected categories in the U.S., including national origin and sexual orientation.

ZUCKERBERG LAYS OUT VISION FOR 'PRIVACY-FOCUSED' SOCIAL NETWORKING

“There is a long history of discrimination in the areas of housing, employment and credit, and this harmful behavior should not happen through Facebook ads,” said Facebook’s Chief Operating Officer Sheryl Sandberg, in a statement. “Housing, employment and credit ads are crucial to helping people buy new homes, start great careers, and gain access to credit. They should never be used to exclude or harm people.”

One of the complaints said that Facebook violated the Fair Housing Act because its targeting systems allow advertisers to exclude certain audiences, such as families with young children or disabled people, from seeing housing ads. Others alleged job discrimination, with ads being shown to men but not women in traditionally male-dominated fields, or only to younger users.

NEW ZEALAND TELECOMS BLAST FACEBOOK, GOOGLE AND TWITTER OVER ATTACK VIDEO'S VIRAL SPREAD

The settlement was described as “historic” by the ACLU. “The tech giant will take long overdue steps to prevent advertisers from discriminating when sending job, housing, and credit ads,” the organization tweeted Tuesday.

The National Fair Housing Alliance also welcomed Facebook’s ad targeting revamp, which it said “will drive unprecedented and sweeping changes” across the tech giant’s advertising platform.

However, the company still faces an administrative complaint filed by the U.S. Department of Housing and Urban Development in August over the housing ads issue.

FACEBOOK APOLOGIZES TO TRUMP'S SOCIAL MEDIA DIRECTOR FOR TEMPORARILY RESTRICTING HIS ACCOUNT

Facebook has been firmly in the spotlight in recent years amid concern over its impact on society. The powerful tech giant has come under increasing pressure over its handling of user data.

The company and its leadership have also faced intense scrutiny to prove Facebook's commitment to privacy. CEO Mark Zuckerberg recently vowed to develop new privacy-shielding messaging services.

FACEBOOK UNDER CRIMINAL INVESTIGATION OVER CONTROVERSIAL DATA-SHARING DEALS

High-profile critics such as President Donald Trump have repeatedly accused Facebook of political bias, an allegation which the company denies.

CLICK HERE TO GET THE FOX NEWS APP

On Tuesday, Facebook apologized to the president's social media director for temporarily restricting his account. The Menlo Park, Calif.-based firm said that the problem was caused by automated bots on its platform.

Fox News' Chris Ciaccia and the Associated Press contributed to this article. Follow James Rogers on Twitter @jamesjrogers