A sharply divided U.S. Supreme Court on Wednesday leveled a blow to public-sector unions by striking down fair-share fees charged to nonunion members for their costs of collective bargaining.

The 5-4 majority, led by Justice Samuel Alito Jr., split along ideological lines in holding that the fees, also known as agency shop fees, violated the First Amendment speech rights of nonunion members.