By Daniel Wiessner

(Reuters) - A federal judge in Texas on Thursday struck down an Obama administration rule that would have extended mandatory overtime pay to more than 4 million U.S. workers, siding with business groups and 21 states that had challenged it.

The decision came after the same judge last year blocked the rule from taking effect pending his final decision. The Trump administration had already said it would make changes to the rule, which riled trade groups and companies when it was adopted.

The rule would have doubled to about $47,000 the maximum salary a worker could earn and still be automatically eligible for overtime pay.

U.S. District Judge Amos Mazzant in Sherman, Texas, said the salary level was set so high that it could sweep in some management workers who are supposed to be exempt from overtime protections.

Nevada Attorney General Adam Laxalt, who represents the 21 states that sued over the rule, applauded the decision in a statement. He said the rule would have forced states to spend millions of dollars on overtime pay and led to private-sector job losses.

The ruling also drew immediate praise from business groups. The National Restaurant Association in a statement said the Obama administration had overstepped its authority in adopting the rule. The group said it would work with the Trump administration "to ensure workable changes to the overtime rule are enacted."

But the union-backed National Employment Law Project said the judge ignored that the U.S. Department of Labor spent two years working on the rule and reviewed nearly 300,000 public comments before adopting it.

Before last year, federal overtime pay regulations had not been changed since 2004, when the salary level was set at $23,660. Workers' rights groups and many Democrats said that threshold unfairly excluded many workers who do not perform any management duties.

The Labor Department last year had appealed Mazzant's decision temporarily blocking the Obama administration rule, weeks before President Donald Trump took office.

Story continues

In June, the department reversed course and asked a federal appeals court to uphold the judge's decision. But the agency also urged the court to clarify that it can use a salary threshold in overtime pay regulations.

On Thursday, Mazzant said the department does have the ability to use a salary test but must base eligibility for overtime pay on a combination of workers' duties and wages.

(Reporting by Daniel Wiessner in Albany, New York; Editing by Alexia Garamfalvi and Cynthia Osterman)