The Supreme Court has struck down a North Carolina law that bars convicted sex offenders from Facebook, Twitter and other popular sites.

The justices ruled unanimously Monday in favor of North Carolina resident Lester Packingham Jr. His Facebook boast about beating a traffic ticket led to his conviction for violating a 2008 law aimed at keeping sex offenders off internet sites children might use.The court rejected the state’s argument that the law deals with the virtual world in the same way that states keep sex offenders out of playgrounds and other places children visit.