Facebook is to change its rules - to prevent companies targeting adverts for jobs, accommodation or credit on the basis of gender, age or postcode.
The company has settled a legal action with the American Civil Liberties Union (ACLU) over the issue.
It had been possible, for example, for employers to display job adverts to men only, which the ACLU said was illegal.
Announcing the change, Facebook said: "Inclusivity is a core value for our company."
The ACLU submitted a complaint in September 2018 to the US Equal Employment Opportunity Commission, claiming that three women in the states of Ohio, Pennsylvania and Illinois were not shown certain job advertisements due to their gender.
The Civil Rights Act of 1964 was among the federal, state and local laws that the ACLU alleged the practice broke.
This landmark 1964 law prevents employers discriminating against a person because of "race, colour, religion, sex, or national origin" and applies to every stage of employment, including recruitment.
In a blog post, chief operating officer Sheryl Sandberg wrote: "There is a long history of discrimination in the areas of housing, employment and credit and this harmful behaviour should not happen through Facebook ads.
"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.
"Getting this right is deeply important to me and all of us at Facebook because inclusivity is a core value for our company."