WASHINGTON — The Supreme Court on Thursday struck down a Minnesota law that barred voters in the state from wearing a wide range of political hats, T-shirts and pins to the polls.

Minnesota had defended its law as a reasonable restriction that keeps order at polling places and prevents voter intimidation.

But the justices ruled 7-2 that the state’s law is too broad, violating the free speech clause of the First Amendment.

Chief Justice John Roberts wrote that “if a state wishes to set its polling places apart as areas free of partisan discord, it must employ a more discernible approach than the one Minnesota has offered here.”

Most states have laws restricting what voters can wear when they cast ballots, but Minnesota’s law was one of the broadest.

It barred voters from casting a ballot while wearing clothing with the name of a candidate or political party.

Also not allowed: clothing that references an issue on the ballot or promotes a group with recognizable political views.

A National Rifle Association T-shirt or shirt with the text of the Second Amendment wouldn’t be allowed, for example, according to the lawyer who argued the case for the state.

Roberts noted that Minnesota, like other states, had sought to balance a voter’s ability to “engage in political discourse” with the ability to “exercise his civic duty in a setting removed from the clamor and din of electioneering.”

“While that choice is generally worthy of our respect, Minnesota has not supported its good intentions with a law capable of reasoned application,” he wrote.

It is unclear exactly how many states the ruling could affect beyond Minnesota.

Both Minnesota and the group challenging the state’s law had said there are about 10

Read more from our friends at the NRA