ProPublica is a nonprofit newsroom based in New York. Sign up for ProPublica's Big Story newsletter to receive stories like this one in your inbox as soon as they are published.

Facebook advertisers can no longer target users by age, gender and ZIP code for housing, employment and credit offers, the company announced Tuesday as part of a major settlement with civil rights organizations.

The wide-ranging agreement follows reporting by ProPublica since 2016 that found Facebook let advertisers exclude users by race and other categories that are protected by federal law. It is illegal for housing, job and credit advertisers to discriminate against protected groups.

ProPublica had been able to buy housing-related ads on Facebook that excluded groups such as African Americans and Jews, and it previously found job ads excluding users by age and gender placed by companies that are household names, like Uber and Verizon Wireless.

“This settlement is a shot across the bow to all tech companies and platforms,” said Peter Romer-Friedman, a lawyer with Outten & Golden in Washington who represented the plaintiffs along with the ACLU. “They need to understand that civil rights apply to the internet, and it’s not a civil rights-free zone.”

Get Our Top Investigations Subscribe to the Big Story newsletter.

The changes apply to advertisers who offer housing, employment and credit offers to U.S.-based users of Facebook, Instagram and Messenger. Facebook said it hopes to implement the requirements by the end of the year.

The agreement also will create a separate online portal for housing, credit and employment offers. Those advertisers will not be able to target users in a geographic area smaller than a 15-mile radius, which advocates say tamps down on “digital” neighborhood redlining.

Housing, job and credit advertisers will also now only be able to choose from a few hundred interest categories to target consumers, down from several thousand. Critics have said such a swath of finely tuned categories, like people interested in wheelchair ramps, are essentially proxies to find and exclude certain groups. Facebook said it will keep more generic interests like “real estate,” “apartment” and “job interview.”

Facebook also said it will create a page where users can see all current housing ads whether or not the users were among those targeted. The agreement says Facebook will also study how algorithms can be biased.

“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,” Facebook Chief Operating Officer Sheryl Sandberg wrote in a statement Tuesday.

The changes are part of Facebook’s settlement in five discrimination lawsuits. Plaintiffs included the Communications Workers of America and several fair-housing organizations, as well as individual consumers and job seekers. The settlement includes a payout of about $5 million to plaintiffs, mostly to defray legal costs.

The company agreed last year to limit advertisers’ ability to target by some demographic categories, following a complaint by Washington state.

Facebook has previously said that it was being held to an unreasonably high standard, and that ads excluding users by age and gender were not discriminatory. “We completely reject the allegation that these advertisements are discriminatory,” Vice President of Ads Rob Goldman wrote in a December 2017 post. “Used responsibly, age-based targeting for employment purposes is an accepted industry practice and for good reason: it helps employers recruit and people of all ages find work.” The post was titled: “This Time, ProPublica, We Disagree.”

Facebook said Tuesday it had “not seen the kind of explicit discriminatory behavior that civil rights groups are concerned about.” But ProPublica used a crowdsourcing project to find dozens examples of job ads that excluded workers over 40, women and other protected groups.

Facebook has made another move recently that resulted in less transparency around ads. This year, it moved to block a ProPublica project that allowed the public to see how political ads are being targeted on Facebook.

The company said it was simply enforcing its terms of service.