California’s blanket primary system, which allows voters to choose candidates from any party, came under heavy attack from the Supreme Court on Monday as a violation of political parties’ First Amendment rights.

Four of the state’s political parties, including the Democrats and Republicans, challenged the blanket primary, approved by voters in a 1996 ballot initiative, as a violation of their freedom of association. They argued it is unconstitutional for the state to force parties to allow non-members a voice in selecting party candidates.