WASHINGTON (Reuters) - The U.S. Supreme Court on Monday appeared poised to strike down a North Carolina law barring convicted sex offenders from Facebook and other social media services, with justices noting the expansive role such online tools play in today’s society.

File Photo: U.S. Supreme Court is seen in Washington, U.S., October 3, 2016. REUTERS/Yuri Gripas/File Photo

Lester Packingham, a registered sex offender due to a statutory rape conviction, challenged the North Carolina law as a violation of his free speech rights under the U.S. Constitution’s First Amendment.

The court heard an hour of oral arguments in Packingham’s appeal of his conviction for violating the statute in 2010 when he posted a message on Facebook expressing his surprise at a traffic citation being dismissed.

Justice Elena Kagan mentioned Donald Trump’s Twitter feed, which he used as a candidate and now as U.S. president, as an example of how social media has become vital in the political sphere.

“The president is speaking to the people through this medium,” Kagan said.

The case, which tested the social media smarts of the notoriously tech-averse justices, is the latest of several in recent years that have explored constitutional rights in the digital age.

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

Leading social media companies like Facebook and Twitter are covered by the law. Opponents of it have raised concerns that the law could be interpreted as covering other online activity in which users must create profiles and can interact with other users. That even could include certain news websites.

Packingham was 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.

Kagan, the youngest of the justices at 56, appeared to speak for the social media generation as she repeatedly mentioned how central to life online interactions have become in recent years. Her questions indicated concerns that the law was written so broadly that it goes beyond the intended purpose of preventing contact between sex offenders and children.

“So whether it’s political community, whether it’s religious community, I mean, these sites have become embedded in our culture as ways to communicate and ways to exercise our constitutional rights, haven’t they?” Kagan asked at one point.

Justice Ruth Bader Ginsburg, the 83-year-old liberal and the oldest member of the court, appeared to share Kagan’s view.

“The point is that these people are being cut off from a very large part of the marketplace of ideas. And the First Amendment includes not only the right to speak, but the right to receive information,” Ginsburg said.

Justice Samuel Alito, a conservative who is 10 years older than Kagan, was more skeptical of people’s reliance on social media, saying they can get information from other sources as they did a decade ago.

But Alito conceded: “Now, I know there are people who think that life is not possible without Twitter and Facebook and these things, and that 2003 was the Dark Ages.”

The law does not require proof that the user intended to use a particular service for an illegal purpose. It also exempted chatrooms and photo-sharing sites, which Kagan seemed to find perplexing because that would be where what she called “the most dangerous activity” would take place.

Packingham was convicted of violating the law after local police saw the Facebook post he wrote upon avoiding the traffic citation. “Praise be to GOD. WOW! Thanks JESUS,” he wrote.

Some of the justices over the years have shown a lack of familiarity with cutting-edge technology even as they set legal rules on such issues as police surveillance and intellectual property protections worth billions of dollars. Last week, Justice Sonia Sotomayor referred to popular video-sharing website YouTube as “the You Tube,” prompting some amused reactions on Twitter.