New York (CNN Business) Seven employers, including Capital One and car rental company Enterprise, violated federal law when they used Facebook ads to exclude workers based on their age, gender or both, according to rulings from the federal agency that enforces laws prohibiting workplace discrimination.

In letters sent to each company -- released by the labor union Communications Workers of America late Tuesday -- the Equal Employment Opportunity Commission said it found "reasonable cause" that the employer violated federal laws by excluding women, older workers or both from seeing their job ads on Facebook. The social network offers advertisers various tools for targeting their desired audience.

The ads are from 2018 and earlier. Facebook has pledged changes since then.

In March, Facebook said it would pay nearly $5 millio n to settle several lawsuits that alleged its advertising platform allowed for discrimination in housing, employment and credit ads. As part of multiple settlements, it also announced major changes, including a separate advertising portal for housing, employment and credit ads that will offer significantly fewer targeting options.

A Facebook spokesperson pointed CNN Business to its recent changes and said helping prevent discrimination in housing, employment and credit ads is an area where it believes it's leading the ad industry.

Read More