A federal judge ordered the Trump administration on Thursday to carry out a plan to close the gender pay gap — a plan the White House has spent the past two years trying to sabotage.

US District Judge Tanya Chutkan scolded the administration for illegally halting an Obama-era rule that required businesses to start reporting employee salary data by race, gender, and job title to the US Equal Employment Opportunity Commission, the federal agency that enforces civil rights laws.

The point of the rule was to force employers to be more transparent about how much they pay workers, and to make it easier for the EEOC to find patterns of potential pay discrimination. It was supposed to go into effect in March 2018, but big business groups, with help from the Trump administration, did everything possible to stop it.

Thursday’s court order says the EEOC must collect the pay data by September, likely putting an end to a drawn-out legal battle over a seemingly bland paperwork change that has the potential to close the persistent gender pay gap in US workplaces.

The controversy over the pay data rule, explained

In 2010, the EEOC and other federal agencies began a process to figure out how to better enforce laws that prohibit pay discrimination. In particular, they were concerned that women still earned about 20 percent less, on average, than men.

Over a six-year period, the EEOC commissioned a National Academy of Sciences study, performed its own pilot study, and organized a working group of business representatives and human resource experts, all aimed at solving the problem of enforcement.

The solution they ultimately came up with? More transparency.

The EEOC decided there was too much secrecy around how much businesses pay their employees. “As a result, employees face significant obstacles in gathering the information that would indicate they have experienced pay discrimination, which undermines their ability to challenge such discrimination,” lawyers for the National Women’s Law Center, a nonprofit women’s rights group, wrote in a 2017 court filing.

So the EEOC, under the Obama administration, crafted the pay data rule to add more transparency to the process. But big business groups, including the US Chamber of Commerce, hated the rule. They argued that it was a huge burden to businesses and questioned how effective it would actually be in closing the pay gap.

When President Donald Trump arrived in the White House, dozens of business groups saw him as a potential ally in their effort to overturn the rule. In March 2017, they wrote a letter to Trump urging him to revoke it. “This expansion means huge additional costs for companies of all sizes, yet has no accompanying benefit, or protections for the confidentiality of the information to be gathered,” they wrote.

Sure enough, in August 2017, the White House Office of Management and Budget put the pay data rule on hold, reasoning that the pay data wasn’t useful and the public didn’t have enough time to comment on the rule change.

Three months later, the National Women’s Law Center and the Labor Council for Latin American Advancement sued the OMB and EEOC, arguing that the OMB’s justification “disregard[ed] the EEOC’s conclusion that collecting pay data is necessary to remedy persistent wage gaps correlated with sex, race, and ethnicity.”

After more than a year arguing about the rule in court, Chutkan reinstated it in April, saying the Trump administration had not taken the proper steps to revoke the regulation and that the administration’s reason to scrap it was “arbitrary, capricious, an abuse of discretion, or otherwise not in accordance with law.”

Since then, both sides have been arguing about how soon businesses should start reporting the detailed salary data. Women’s rights advocates wanted a September deadline. The White House and the business coalition wanted to push it back to 2021.

On Thursday, Chutkan chose a September deadline — a huge win for women and workers of color who often face discrimination in the workplace.

Gender discrimination is a key reason women still get paid less than men

You’ve probably heard this statistic by now: Women who work full time in the US earn, on average, 82 cents for every dollar a man earns — a number that has hardly budged since 2004. The gap has even widened a bit in the past four years.

Several factors explain this difference, but researchers believe a big part of it is due to discrimination. But that’s really hard to prove, for one simple reason: No one really knows what private employers are paying women and workers of color.

Democrats in Congress have tried, and failed, to change this fact for more than two decades. And now they’re trying again. In January, Rep. Rosa DeLauro (D-CT) and her colleagues reintroduced the Paycheck Fairness Act — for the 11th time.

The bill would require employers to report, among other things, job salaries, promotions and dismissals to the federal government, broken down by gender and race. The bill would essentially turn the new pay data rule into law and make it illegal for a future administration to revoke. The bill would also ban wage secrecy, increase penalties for employers who retaliate against workers who share salary information, and allow workers to sue for pay discrimination.

This time around, Democrats have momentum on their side. They have the House majority, and their bill has support from every single Democratic lawmaker — more than ever before. House Speaker Nancy Pelosi publicly championed the bill too, signaling that it is a high priority for the caucus.

It’s part of a larger agenda “to make women in the workplace have the opportunities that we all should have,” Pelosi said during a press conference on January 30.

The proposal will pass the House easily, but Democrats will need support from some Senate Republicans and President Trump in order for it to become law. Considering that the White House has spent two years trying to sabotage the pay data rule, it seems unlikely that Trump will feel inclined to write it into law.