Thousands of home health-care workers cannot be forced to pay union fees if they are not in a union, the Supreme Court ruled Monday, dealing a defeat to organized labor and foreshadowing a potentially far more serious blow to come.

By a 5-to-4 vote, the court’s conservative justices said an Illinois requirement that home health aides help cover a union’s cost of collective bargaining violates their First Amendment right to free speech.

The case had prompted widespread concern among public-sector unions because Illinois had deemed the aides, who are paid by the state, to be public employees. But the court said the aides are only quasi-public because their real employers are their patients.

“If we accepted Illinois’ argu­ment” that the workers can be forced to pay the union fees against their will, Justice Samuel A. Alito Jr. wrote for the majority, “we would approve an unprecedented violation of the bedrock principle that, except perhaps in the rarest of circumstances, no person in this country may be compelled to subsidize speech by a third party that he or she does not wish to support.”

While the decision is a setback for unions that have sought to increase their depleted ranks by organizing the growing sector of home health-care workers, legal experts said its scope is narrow because it applies only to a relatively small segment of employees.

Since the court said the Illinois workers are not full-fledged public employees, they are not covered by a 1977 precedent that says states have the power to require those employees to pay union fees, as long as the fees are not used for political activities.

The decision’s real significance, experts said, lies in the language the court’s conservatives used in attacking that 1977 decision, even as they stopped short of overturning it.

Alito — joined by Justices Antonin Scalia, Clarence Thomas and Anthony M. Kennedy and Chief Justice John G. Roberts Jr. — devoted page after page to criticizing the earlier decision and its “questionable foundations” before concluding that this was not the right case to overturn it.

New threat to 1977 ruling

While the Roberts court typically avoids upsetting precedent if there are other ways to decide a case, legal specialists and the court’s liberal wing said Alito’s language signaled that an all-out assault on the 1977 case, Abood v. Detroit Board of Education, could be in the offing.

“I think Abood is in serious jeopardy of being overturned if the proper case can be found,” said Joel Barras, a Philadelphia labor and employment lawyer who represents companies and public employers. That, he said, would be “potentially devastating” to organized labor because public-sector unions would lose revenue.

About half the states now use the 1977 law to require union fees from public-sector workers even if they are not in a union.

Justice Elena Kagan, writing for the court’s four dissenters, also seemed to be previewing the arguments to come if the conservative majority takes up a direct challenge to Abood.

The precedent of allowing states to require the union fees is “deeply entrenched,” she wrote, “and is the foundation for not tens or hundreds, but thousands of contracts between unions and governments across the Nation.”

Kagan wrote that “the majority could not restrain itself from saying (and saying and saying)” that it dislikes Abood. Still “the majority could not, even after receiving full-dress briefing and argument, come up with reasons anywhere near sufficient to reverse the decision.”

Kagan was joined by Justices Ruth Bader Ginsburg, Stephen G. Breyer and Sonia Sotomayor.

The case pitted right-to-work supporters against labor unions and the Obama administration, and its political significance was clear, and even acknowledged by the justices. At oral arguments, Kagan mentioned a union-related controversy in Wisconsin that led to an unsuccessful attempt to recall Gov. Scott Walker (R).

Public-employee unions are a major player in Democratic politics, and disputes between the unions and Republican governors have become frequent and bitter. The union that organized the Illinois home health aides, the Service Employees International Union (SEIU), is a major contributor to Democratic campaigns.

Reflecting the political stakes, Monday’s decision drew support from right-to-work advocates and conservative legal groups and criticism from union leaders and the Obama administration.

“By organizing together, [home care] workers have improved both their own working conditions and the quality of services they provide,” Labor Secretary Thomas Perez said in a statement. “Today’s Supreme Court decision will make it more difficult for home care workers to have a united voice and the support they need to best serve their clients.”

Union vows to persist

SEIU officials vowed to work around the restrictions imposed by the high court. “No court case is going to stand in the way of home care workers coming together to have a strong voice for good jobs and quality home care,” said Mary Kay Henry, president of the organization, whose 2.1 million members include 400,000 home health-care workers.

Pam Harris, one of eight Illinois home health aides who had sued the state over the union fee requirement, hailed the ruling. “We celebrate knowing that Illinois moms linked arms and refused to be bullied,” she said. “Families in Illinois can relax knowing their homes are safe from being a union workplace and there will be no third party intruding into the care we provide our disabled sons and daughters.”

The home health aides provide care to elderly Medicaid recipients who cannot live alone without assistance. Many of the aides, known as personal assistants, are relatives of the person receiving care.

When some of the personal assistants tried to unionize in the 1980s, the Illinois Labor Relations Board said that was not possible, because they were not solely employed by the state.

But then-Gov. Rod Blagojevich (D) and the Illinois legislature extended collective-bargaining rights to the workers in 2003, and the SEIU became their representative.

The group of workers sued, arguing that they did not want to be compelled to pay union fees, and lost. The U.S. Court of Appeals for the 7th Circuit said the rehabilitation workers were rightly considered state employees and thus could be charged fees under Abood.

After the Supreme Court decided to take the workers’ appeal, the National Right to Work Committee raised the stakes by asking the court to overrule Abood. The committee also argued that Blagojevich’s move was simply a “political payback” to the SEIU.

Attorneys for Illinois argued that extending collective-bargaining rights to the home health aides had been beneficial, with their pay and benefits increasing and more workers willing to stay in the demanding jobs.

Alito’s ruling hinged on whether the aides were public employees and thus covered by the Abood decision. He concluded that they were not, because even though the state, subsidized by Medicaid, pays their salaries, their patients hired them and were “responsible for control­ling all aspects of the employment relationship.’’

“If we allowed Abood to be extended to those who are not full-fledged public employees, it would be hard to see just where to draw the line,” Alito wrote. “We refuse to extend Abood in the manner that Illinois seeks.’’

The case is Harris v. Quinn.