According to the ruling, doing so violates the Equal Pay Act and perpetuates wage gaps between men and women.

The ruling comes after a teacher in California sued her employer after learning she made less money than her male colleagues, even though she had more experience. Her employer said the difference was because she made less at previous jobs.

Women made about 80 cents for every dollar a man made in 2015, according to the U.S. Department of Labor. Advocates say the decision will help close that gap.