WASHINGTON — The Supreme Court debated sex, violence and free speech Tuesday, as several justices strongly argued for breaking new ground and upholding a California law that would forbid the sale of violent video games to those under age 18.

“Why isn’t it common sense,” said Justice Stephen Breyer, that if the law can forbid selling pictures of a “naked woman” to a young teenager, it can also forbid the sale of scenes “of gratuitous torture of children” in a video game?

Chief Justice John Roberts agreed, citing scenes from the game “Postal 2” in which girls are smashed in the face with a shovel and their bodies set on fire. “We don’t have a tradition in this country” of exposing children to that kind of graphic violence, he said.

But in a case that seemed to break the usual liberal-conservative alliances, Justice Antonin Scalia clashed with Roberts and Breyer and argued that the First Amendment’s protection of freedom of speech has never been used to restrict violence in the media.

“The same argument could have been made when movies came out” that exposing children to violence would harm them, he told a lawyer for California.

The state’s video games law was struck down as unconstitutional before it went into effect. Similar laws in other states have met the same fate.

The justices voted to hear California’s appeal, but they sounded split Tuesday.

Scalia insisted that since the nation’s founding, depictions of sex could be banned, but not depictions of violence and torture.

This drew a mocking rebuke from Justice Samuel Alito, who is usually allied with Scalia on the conservative side. When Scalia pressed the state’s lawyer to explain how the framers of the First Amendment would see the issue, Alito interjected: “What Justice Scalia wants to know is what James Madison thought about video games,” Alito said to laughter in the courtroom.

Later, Alito said he disagreed with Scalia’s historical approach to deciding this constitutional question. Video games are a medium “not envisioned at the time of the founding,” he said, and it “is entirely artificial” to decide based on a guess as to what the 18th-century framers would have thought.

Alito signaled he agreed with Roberts and Breyer that the state can “restrict minors’ access to violent, sadistic and graphic” video games.

But Justices Ruth Bader Ginsburg and Sonia Sotomayor joined with Scalia in raising free-speech objections to California’s law. “Could you get rid of rap music?” Sotomayor asked at one point, since the lyrics “talk about killing people.”

No, replied Zachery Morazzini, the deputy state attorney general for California. He said the state law focuses on video games in which the player can kill or maim a lifelike figure of an innocent human being. He argued that video games are far more troubling than movies, music or television, because the children and teens are active participants in the killing and maiming, not just “passive observers.”

Justices Anthony Kennedy and Elena Kagan, who hold key votes, questioned both sides without tipping their hands.

permitting restrictions on violence in the media, “you are asking us to go into an entirely new area,” Kennedy told the state’s lawyer. He added he worried that the state’s definition of a banned game was “vague” and wouldn’t be clear to game makers or retailers. Those who violate the law could be hit with a fine of $1,000 per game sold.

But Kennedy also questioned why violence in the media always deserved protection under the First Amendment.

“Why shouldn’t violence be treated the same as obscenity?” he asked, subject to strict limits when minors are the audience.

In the court’s last term, Roberts spoke for the court when it struck down on a free-speech grounds a federal measure that outlawed videos of dog fighting and other acts of animal cruelty. However, Roberts commented during Tuesday’s argument that his opinion left open the possibility that a law focused on so-called “crush videos,” involving the killing of tiny animals, would be upheld.

He suggested the court could uphold California’s law by keeping it narrowly focused on the video games that expose children and teens to graphic and sadistic violence. But it was unclear whether he’d have a majority to do that.