(Reuters) - A federal judge on Tuesday blocked an Obama administration rule to extend mandatory overtime pay to more than 4 million salaried workers from taking effect, imperiling one of the outgoing president’s signature achievements for boosting wages.

With the Washington Monument looming in the background, a crew works on the roof of the newly constructed United States Institute of Peace in Washington January 21, 2010. REUTERS/Kevin Lamarque

U.S. District Judge Amos Mazzant, in Sherman, Texas, agreed with 21 states and a coalition of business groups, including the U.S. Chamber of Commerce, that the rule is unlawful and granted their motion for a nationwide injunction.

The rule, issued by the Labor Department, was to take effect Dec. 1 and would have doubled to $47,500 the maximum salary a worker can earn and still be eligible for mandatory overtime pay. The new threshold would have been the first significant change in four decades.

It was expected to touch nearly every sector of the U.S. economy and have the greatest impact on nonprofit groups, retail companies, hotels and restaurants, which have many management workers whose salaries are below the new threshold.

The states and business groups claimed in lawsuits filed in September, which were later consolidated, that the drastic increase in the salary threshold was arbitrary.

On Tuesday, Mazzant, who was appointed by President Barack Obama, ruled that the federal law governing overtime does not allow the Labor Department to decide which workers are eligible based on salary levels alone.

The Fair Labor Standards Act says that employees can be exempt from overtime if they perform executive, administrative or professional duties, but the rule “creates essentially a de facto salary-only test,” Mazzant wrote in the 20-page ruling.

The states and business groups that challenged the rule applauded the decision.

Nevada Attorney General Adam Paul Laxalt said in a statement that the ruling “reinforces the importance of the rule of law and constitutional government.”

The Labor Department said it strongly disagrees with the decision. It remains confident that the entire rule is legal, and it is currently considering its options, department spokesman Jason Surbey said.

The Labor Department can appeal to the New Orleans, Louisiana-based 5th U.S. Circuit Court of Appeals, but that court has stymied the Obama administration before, blocking Obama’s executive actions on immigration in 2015.

In any case, the Labor Department could drop the appeal after Republican President-elect Donald Trump takes office in January.

In August, Trump told the website Circa that the overtime rule was an example of the type of burdensome business regulations he would seek to roll back as president, perhaps by exempting small businesses or delaying implementation.

Even if the rule survived the legal challenge, it could be upended by legislation passed by Congress or withdrawn by Trump’s Department of Labor.

U.S. Chamber of Commerce official Randy Johnson said in a statement that the rule would have been costly and disruptive to businesses.

But Ross Eisenbrey of the left-leaning Economic Policy Institute, which supported the rule, called the decision “extreme and unsupportable.”

“It is also a disappointment to millions of workers who are forced to work long hours with no extra compensation, and is a blow to those Americans who care deeply about raising wages and lessening inequality,” Eisenbrey said in a statement.

The case is Nevada v. U.S. Department of Labor, U.S. District Court for the Eastern District of Texas, No. 16-cv-731.