The Supreme Court ruled Thursday that a Minnesota law banning political apparel in polling stations violates the First Amendment.

A state law in Minnesota said that voters can not wear apparel with political symbols at polling stations, including buttons or articles of clothing. Before the 2010 election, the non-partisan Minnesota Voters Alliance challenged that ban, arguing that the ban violated voters' First Amendment right to free speech.

The Court agreed, voting 7-2 that the Minnesota law was too broad and violated the First Amendment by banning all political apparel.

In the majority opinion, Chief Justice John Roberts said that Minnesota's state law tried to balance between rights to free speech and giving voters an opportunity to vote without distractions from political campaigns in the polling place, but that ultimately banning "political insignia" without specifically defining what it includes was too broad.

"Minnesota's ban on wearing any "political badge, political button, or other political insignia" plainly restricts a form of expression within the protection of the First Amendment," Roberts said.

Roberts said the government can impose some restrictions on speech in public places but there is a high bar for restricting speech based on content and that it can't be restricted because of the person's opinions.

The Court wrote that even though the broader law violated the First Amendment that not all state laws limiting political items at polling stations are unconstitutional. Minnesota and other states could still prohibit certain kinds of apparel with a political message inside polling places, "so that voters may focus on the important decisions immediately at hand."