The U.S. Supreme Court on Thursday struck down a Minnesota law that prohibits people from wearing political clothing or buttons at polling places, calling the ban overly broad but leaving room for the state to impose narrower restrictions.

The 7-2 ruling invalidating the particulars of Minnesota's law left state and county officials who administer elections unsure what's proper attire and what isn't for the upcoming August primary and the November general election.

Chief Justice John Roberts wrote for the majority that Minnesota's law needed clearer parameters for both voters and election officials to avoid confusion and prevent potential violations of First Amendment free-speech rights.

Roberts wrote that "the State must be able to articulate some sensible basis for distinguishing what may come in from what must stay out."

Justices Sonia Sotomayor and Stephen Breyer dissented. Sotomayor wrote that the majority opinion was based on "hypothetical line-drawing" and said the case should have been thrown back to the Minnesota Supreme Court to make a definitive interpretation.

The decision was cheered by members of the three conservative or libertarian groups — the Minnesota North Star Tea Party Patriots, the Minnesota Majority and the Minnesota Voters Alliance — that filed the lawsuit eight years ago over Minnesota's polling-place ban on "political" badges, buttons and other insignia.

On Election Day in 2010, members of those groups turned out to vote wearing buttons reading "Please ID me," and at least one person wore a T-shirt with a Tea Party logo that said "Don't tread on me." Officials at polling places in Hennepin and Ramsey counties challenged those voters, who responded by suing county election administrators and former Secretary of State Mark Ritchie.

Dan McGrath, a spokesman for the Minnesota Voters Alliance, said he and others who filed the lawsuit want Minnesota lawmakers to follow the lead of other states in drafting a new law. The Supreme Court ruled more than two decades ago that states can prohibit people from displaying and handing out campaign materials at the polls, and all states have some kind of law about what is acceptable for voters.

McGrath said the ban should be specific to clothing that advertises for candidates and issues in a particular election.

"That's a clear line everyone can understand," he said.

Minnesota Secretary of State Steve Simon said Thursday that he agrees. He said the Supreme Court's ruling gives Minnesota a "pretty good road map" to write a new law that better protects voters' First Amendment rights and ends a long period of uncertainty.

"Elections administrators were in limbo for many years about what line the Supreme Court was going to draw, and now we know," Simon said.

But it's unlikely the law will be revised until next year; the Legislature adjourned in May and is not scheduled to reconvene until January. Gov. Mark Dayton has reiterated that he had no plans to call a special session in 2018.

That means election officials will open polling places this year with some uncertainty about what's allowed. Simon said his office will work with local elections officials to help avoid problems.

Ramsey County Elections Manager Joe Mansky, who was named in the lawsuit, said he's glad the Supreme Court recognized election officials' interest in preventing people from trying to influence voters inside polling places. But he said the ruling fails to clarify exactly what he should tell poll workers to do.

Mansky knows he can tell people not to wear shirts with candidates' names or the name of a political party, but he said it's still unclear what kinds of slogans are protected speech.

"For example: 'Make America Great Again,' " he said. "What is that? If someone walks in with a 'Make America Great Again' hat or T-shirt, what are we supposed to do?"

When they heard the case in February, the U.S. Supreme Court justices had some of the same questions. In a back-and-forth with Daniel Rogan of the Hennepin County Attorney's Office, Justice Samuel Alito wondered what elections officials should do about a shirt printed with a rainbow flag or logos for a labor union, the Reagan/Bush 1984 presidential campaign or the National Rifle Association. He also wondered about someone wearing a Colin Kaepernick jersey, the NFL player known for kneeling during the national anthem to protest racial injustice.

On Thursday, Simon said he's still sorting out the nuances of the ruling.

Erick Kaardal, an attorney who represented the groups that challenged Minnesota's law, said the state needs to act quickly to get those questions answered before upcoming elections.

"The job of an election judge should be very simple, and if you're requiring them to read the statute and then the U.S. Supreme Court decision, that's more than they signed up for," Kaardal said. "They're there to apply the rules, not interpret them."

Erin Golden • 612-673-4790