With just two weeks to go until the end of its term, the Supreme Court ruled 7-2 in Minnesota Voters Alliance v. Mansky that Minnesota’s ban on so-called “political” apparel at the polls on Election Day violates the First Amendment.

With Thursday’s decision, the high court has restored the ability of voters in Minnesota to express their views on everything from the Second Amendment to the #MeToo movement.

Minnesota had a very restrictive law that not only prohibited active campaigning in polling places, but also barred voters from wearing badges, buttons, and other items with a “political” message. But the state’s definition of what it considered to be “political” was so broad that even a T-shirt that simply said “Vote!” could be prohibited.

The court was right to invalidate Minnesota’s law, which prevented Andrew Cilek, the executive director of the Minnesota Voters Alliance, from wearing his “Don’t Tread on Me” T-shirt and a “Please I.D. Me” button to the polls on Election Day.

Minnesota said that if you showed up at a polling place wearing a T-shirt with the historic and famous Gadsden flag on it—the first flag of the Continental Marines—you could get thrown out.

Apparently wearing a T-shirt with a picture of a coiled rattlesnake and the phrase “Don’t Tread on Me” is a “political” message that must be banned.

>>> Listen to “SCOTUS 101”: Elizabeth Slattery and Tiffany Bates bring you up to speed on their Supreme Court podcast.

While states have legitimate interests in ensuring the integrity of their elections and preventing intimidation, coercion, and other harassment of voters at the polls, they don’t have a legitimate interest in stamping out speech on clothing because it might “trigger” people at the polls.

The court found as much in 1992, when it upheld Tennessee’s ban on active campaigning within 100 feet of a polling place. But Minnesota’s law went further, prohibiting not just campaigning, but all “political” speech, even if it’s unrelated to the election at hand, maintaining that this was necessary to protect voters’ ability to vote in an “orderly and controlled environment without confusion, interference, or distraction.”

Yet the state couldn’t come up with a clear set of objective guidelines for determining what is “political.” At the oral argument in March, for example, the state’s lawyer said a T-shirt with the text of the First Amendment would be allowed at the polls, but not a T-shirt with the text of the Second Amendment.

The state also said it could ban any “issue-oriented material designed to influence or impact voting.” But what qualifies as an “issue”? The only answer the state could give was “any subject on which a political candidate or party has taken a stance.”

Under that definition, the court in its ruling asked: Would a “Support Our Troops” shirt be banned “if one of the candidates or parties had expressed a view on military funding or aid for veterans?”

Would a #MeToo shirt be banned if someone talked about sexual harassment and assault? The state said such shirts would be banned if a candidate talked about those issues.

The state also claimed it could ban any item “promoting a group with recognizable political views.” Thus, the state could ban any T-shirt with the name of numerous associations, educational institutions, businesses, and religious organizations that “have an opinion on an issue” in a given election, including organizations such as the ACLU, the AARP, and Ben & Jerry’s Ice Cream.

Under that bizarre view, the court said, the state could have barred a Boy Scout leader in his uniform who stopped at a polling place “on his way to a troop meeting” during the 2012 election, since the “[p]residential candidates of both major parties issued public statements regarding the then-existing policy of the Boy Scouts of America to exclude members on the basis of sexual orientation.”

>>> Join us on July 10 at Heritage for a roundup of the big Supreme Court decisions.

Unsurprisingly, seven members of the court found this law could not withstand First Amendment scrutiny.

Writing for the majority, Chief Justice John Roberts explained that states may place some content-based restrictions on speech at polling places, but they must be able to come up with a reasonable basis for those restrictions.

Roberts wrote that Minnesota’s “unmoored use of the term ‘political’” and its “haphazard interpretations” failed even that low bar.

He explained that Minnesota’s law placed far too much discretion in the hands of poll workers: “A rule whose fair enforcement requires an election judge to maintain a mental index of the platforms and positions of every candidate and party on the ballot is not reasonable.”

And Minnesota isn’t alone—at least nine other states have similar bans on political apparel, and news stories pop up frequently during election years about overzealous poll workers enforcing restrictions on speech.

For example, during the 2016 election, “Reagan/Bush” and “I miss Bill” T-shirts were prohibited in Arizona. In 2012, poll workers cracked down on people wearing MIT apparel (as in “Massachusetts Institute of Technology”) because Mitt Romney was on the ballot.

In 2008, a woman in Texas was singled out for wearing an Alaska T-shirt when Sarah Palin was on the ballot.

These bans reached apparel that conveyed political messages from another era, as well as apparel that had nothing whatsoever to do with politics. It’s hard to see how any of these messages would have unduly influenced other voters casting their ballots.

The court’s ruling doesn’t mean voters should show up to the midterm elections in November with “Make America Great Again” hats and other T-shirts, buttons, and items celebrating certain candidates, parties, or issues on the ballot.

Many states prohibit express advocacy by voters within polling places. Texas, for example, prohibits wearing apparel related to a candidate, measure, or political party appearing on the ballot. And California bars apparel with the name, likeness, or logo of a candidate or ballot measure.

The court pointed to these state laws to show how vague and overbroad Minnesota’s law was by comparison.

Justice Sonia Sotomayor dissented, joined by Justice Stephen Breyer, arguing that the court should have sent the case to the Minnesota Supreme Court for interpretation of the state’s law, but the majority did not think that was necessary.

In fact, the majority pointed out that Minnesota had only made this request for certification to state court after more than seven years in federal court when the case reached the Supreme Court.

There was no reason to send the case to state court to construe a statute that plainly violates the First Amendment.

The ability to speak your mind and express yourself is a foundational right in American society, and that should extend to the polls on Election Day. Some limits to prevent harassment, intimidation, and the like are reasonable, but the Minnesota law was the exact opposite of reasonable.

The Supreme Court was right to find that the First Amendment doesn’t stop at the doors to the polling place. This ruling is a win for all Americans.