PORTLAND (AP) – A federal judge Friday rejected a challenge to the imposition of service fees on state workers who choose not to join the Maine State Employees Union but receive union protection.

Twenty employees represented by a Virginia-based foundation that furnishes legal aid to employees who believe their rights have been violated by compulsory unionism had gone to court to challenge the so-called “fair share fees” that are assessed in lieu of dues.

In his 21-page ruling, Judge George Singal concluded that the 10,000-member union protected the constitutional rights of all state workers when it implemented service fees in its collective bargaining agreement that took effect in 2005.

Singal noted that the Supreme Court nearly 30 years ago found that contracts between unions and public employers may require nonmembers to make payments in lieu of dues to avoid having “free riders” take advantage of union services without contributing financially.

The lawsuit had sought to return to nonmembers all of their past payments, which equal weekly membership dues less the amount spent for political purposes.

Union President Dana Graham applauded the summary judgment in favor of the MSEA, a unit of the Service Employees International Union.

“Today’s ruling simply affirms what we have known all along: that this union operates in full compliance of all laws and respects everyone’s rights,” Graham said.

The National Right to Work Legal Defense Foundation said it will appeal Singal’s ruling on grounds that thousands of state employees are still entitled to the return of all payments collected before the fee calculation was changed.

to correct deficiencies.

“The Maine Legislature created this problem in the first place by allowing the practice of forcing workers to pay dues to an unwanted union or be fired from their jobs,” said Justin Hakes, the foundation’s director of legal information.

Several state officials were also named as defendants in the lawsuit.