WASHINGTON — The Supreme Court on Friday upheld a Texas law aimed at blocking children from seeing online pornography.

Nearly half of the states have passed similar laws requiring adult website users to verify their ages to access pornographic material. The laws come as smartphones and other devices make it easier to access online porn, including hardcore obscene material.

The court split along ideological lines in the 6-3 ruling. It’s a loss for an adult-entertainment industry trade group called the Free Speech Coalition, which challenged the Texas law.

Th majority opinion, authored by Justice Clarence Thomas, found the measure didn’t seriously restrict adults’ free-speech rights. “Adults have the right to access speech obscene only to minors ... but adults have no First Amendment right to avoid age verification,” he wrote.

In a dissent, Justice Elena Kagan wrote that the court should have used a higher legal standard in weighing whether the law creates free-speech problems for adults. “I would demand Texas show more, to ensure it is not undervaluing the interest in free expression,” she wrote.

Pornhub, one of the world’s busiest websites, has stopped operating in several states, including Texas, citing the technical and privacy hurdles in complying with the laws.

Texas Attorney General Ken Paxton, a Republican, celebrated the ruling. “Companies have no right to expose children to pornography and must institute reasonable age verification measures,” he said. The decision could pave the way for more states to adopt similar laws as one of several steps to prevent children from being exposed to pornography, the group National Center on Sexual Exploitation said.

While the Free Speech Coalition agreed that children shouldn’t be seeing porn, it said the law puts an unfair free-speech burden on adults by requiring them to submit personal information that could be vulnerable to hacking or tracking.

Alison Boden, its executive director, called the ruling disastrous. She said that minors have already found ways to find sexual content online despite the law and its “massive chilling effect on adults.”

The age verification requirements fall on websites that have a certain amount of sexual material, rather than search engines or social-media sites that can be used to find it.

Samir Jain, vice president of policy at the nonprofit Center for Democracy & Technology, said that age verification requirements raise serious privacy and free-expression concerns.