In a unanimous decision, the Supreme Court struck down a law that prevented sex offenders from using social media.
The 2008 law from North Carolina sought to prevent registered sex offenders from accessing "commercial social networking" websites, like Facebook, that allowed minors to create accounts.
And it was a Facebook post that landed the case in the high court. In 2010, convicted sex offender Lester Packingham posted about beating a traffic ticket.
The state argued the law prevented sex offenders from having access to children, just like laws banning offenders' access to schools and playgrounds.
But the court disagreed.
Justices Ruth Bader Ginsburg, Sonia Sotomayor, Elena Kagan and Stephen Breyer joined Justice Anthony Kennedy's majority opinion. Kennedy wrote that the "sweeping law" went too far.
By banning access to many social media sites, Kennedy said, the state was actually unfairly restricting free speech.
Louisiana is the only other state with a similar law, but it only applies to those convicted of sex crimes with children. Kennedy wrote that a more specific law prohibiting contact with minors over social media would be more effective and could still be constitutional.
Justice Samuel Alito wrote a concurring opinion. He, Justice Clarence Thomas and Chief Justice John Roberts agreed with the bulk of what Kennedy wrote.
But they were concerned with equating the internet to a real-world public space. Alito wrote the comparison could make it harder for states to pass laws that restrict sex offenders' access to certain websites, like dating services.
Kennedy called the case "one of the first this Court has taken to address the relationship between the First Amendment and the modern Internet."
The final decision was 8-0. Justice Neil Gorsuch didn't participate in the consideration or decision of the case.