The U.S. Supreme Court has agreed to hear a challenge to a North Carolina law which bans registered sex offenders from accessing social networks open to minors.

The justices agreed to hear sex offender Lester Packingham’s appeal of his conviction for violating the state law in 2010 when he posted a message on Facebook expressing his surprise at a traffic citation being dismissed.

Local police saw the Facebook post, prompting his arrest. Packingham is on North Carolina’s sex offender list because of his 2002 conviction at age 21 on two counts of statutory rape of a 13-year-old girl.

The North Carolina law, enacted in 2008, makes it a felony for people on the state’s sex offender registry to access websites that can lead to social interactions with minors.

The ban extends to sites like Facebook and Twitter that allow people to create personal profiles. The law does not require any proof that the user intended to use the site for an illegal purpose.

Packingham was sentenced to six to eight months in prison, suspended for a year.

An intermediate appeals court threw out the conviction, saying it violated the U.S. Constitution’s First Amendment guarantee of free speech.

The state Supreme Court reversed that decision in November 2015, ruling in part that Packingham’s free speech rights were not unduly burdened because there are ample other websites he could access.