It has been months of whiplash for teachers unions. The nation’s highest court decided on Wednesday that they, and other public sector unions, can no longer collect agency fees, which are currently mandatory in 22 states.

The ruling came down after the unions racked up a series of victories early this year, taking part in teacher walkouts in six states and winning raises and new education dollars from conservative lawmakers.

Now, teachers unions could lose up to a third of their members and funding as a result of the decision, labor experts say, some of the same money that fueled the walkouts.

“Members and money are power in politics,” said Terry Moe, a Stanford political science professor who has written critically of the unions. “This will weaken the teachers unions nationwide as a political force.”