The Supreme Court dealt a blow to public-sector unions Monday, ruling that thousands of home health care workers in Illinois cannot be required to pay fees that help cover a union's costs of collective bargaining.

In a 5-4 split along ideological lines, the justices said the practice violates the First Amendment rights of nonmembers who disagree with the positions that unions take.

The ruling is a setback for labor unions that have bolstered their ranks and their bank accounts in Illinois and other states by signing up hundreds of thousands of in-home care workers. It could lead to an exodus of members who will have little incentive to pay dues if nonmembers don't have to share the burden of union costs.

But the narrow ruling was limited to "partial-public employees" and stopped short of overturning decades of practice that has generally allowed public sector unions of teachers, firefighters and other government workers to pass through their representation costs to nonmembers.

Writing for the court, Justice Samuel Alito said home care workers "are different from full-fledged public employees" because they work primarily for their disabled or elderly customers and do not have most of the rights and benefits of state employees. The ruling does not affect private-sector workers.

The case involves about 26,000 Illinois workers who provide home care for disabled people and are paid with Medicaid funds administered by the state. In 2003, the state passed a measure deeming the workers state employees eligible for collective bargaining.

A majority of the workers then selected the Service Employees International Union to negotiate with the state to increase wages, improve health benefits and set up training programs. Those workers who chose not to join the union had to pay proportional "fair share" fees to cover collective bargaining and other administration costs.

A group of workers led by Pamela Harris, a home health aide, filed a lawsuit arguing the fees violate the First Amendment. Backed by the National Right to Work Legal Defense Foundation, the workers said it wasn't fair to make someone pay fees to a group that takes positions the fee-payer disagrees with.

The workers argue they are not different from typical government employees because they work in people's homes, not on government property, and are not supervised by other state employees. And they say the union is not just seeking higher wages, but also push for expansion of Medicaid payments. Alito agreed.