Facebook announced on Tuesday that it has reached a settlement with civil rights organizations and labor groups that had accused the company of enabling discrimination in housing, employment and credit advertising.

As part of the settlement, the company will introduce changes to its ad platform that prevent advertisers for housing, employment or credit from discriminating based on race, ethnicity, sexual orientation, disability and several other factors covered by federal, state, and local civil rights laws.

This will include the creation of a separate advertising portal for housing, employment and credit ads across the Facebook platforms, including Facebook, Instagram and Messenger.

"Housing, employment, and credit ads are crucial to helping people buy new homes, start great careers, and gain access to credit," Facebook chief operating officer Sheryl Sandberg wrote in a memo. "They should never be used to exclude or harm people. Getting this right is deeply important to me and all of us at Facebook because inclusivity is a core value for our company."

The National Fair Housing Alliance (NFHA), Communications Workers of America (CWA) and individuals represented by the American Civil Liberties Union (ACLU) were among those who brought lawsuits against Facebook over the last three years alleging discrimination.

In a federal complaint filed last March, the NFHA and several other housing rights organizations claimed Facebook continued to “enable landlords and real estate brokers to bar families with children, women and others from receiving rental and sale ads for housing."

The complaint said the tech company made it possible for housing discrimination through their “pre-populated lists of demographics, behaviors and interests."

"Facebook’s ability to customize an online audience for advertisements based on its vast trove of user data has made it the biggest advertising agency in the world—the advertising platform of choice for millions of businesses," the complaint said. "But Facebook has abused its enormous power."

A few months later in September, the CWA and the ACLU filed charges with the Equal Employment Opportunity Commission against Facebook and 10 other employers, alleging that the social media platform helped employers exclude female candidates from recruiting campaigns.