WASHINGTON _ Justice Brett Kavanaugh took his seat on the Supreme Court for the first time Tuesday and quickly joined the questioning as justices struggled to make sense of a federal law that imposes longer prison terms on criminals who have three violent felonies on their records.

At 10 a.m., the justices emerged from behind the chamber's red velvet curtain, and Kavanaugh, after surviving one of the ugliest Senate confirmation battles in modern history, took his seat at the far end of the bench next to Justice Elena Kagan. They laughed and chatted until the argument got underway.

Chief Justice John G. Roberts Jr. paused at the start to welcome the court's new member. "Justice Kavanaugh, we wish you a long and happy career in our common calling," he said.

It was quiet and orderly in and around the court Tuesday, in sharp contrast to Saturday afternoon when a crowd of loud and angry demonstrators occupied the front steps of the building after Kavanaugh won confirmation in the Senate a block away.

Kavanaugh's first case involved how to interpret the federal sentencing law. No one was disputing the aim of the Armed Career Criminal Act, which is supposed lock up repeat violent criminals. Rather, lawyers were arguing whether a purse snatching or breaking into a recreational vehicle counts as a violent felony that could lead to an extra 15 years to life in prison.

For their part, the justices seemed to be a lighter mood than normal. When Justice Sonia Sotomayor asked about whether a sharp pinch counts as violent force, she turned as though ready to pinch Justice Neil M. Gorsuch seated next to her. He recoiled in mock horror.

The court heard two cases interpreting the same law. In Stokeling vs. United States, a lawyer for Denard Stokeling, a Florida man, argued that his 20-year-old conviction for "unarmed robbery" for snatching a woman's necklace should not be deemed a violent felony. Government lawyers disagreed and argued "robbery by sudden snatching" involves a use of physical force.

Kagan asked a government lawyer whether grabbing a woman's handbag from her shoulder would qualify as a violent felony.

Yes, the attorney said.

Kagan was not convinced. "I'm walking down the street and somebody grabs my handbag. I'm not happy about it. But it doesn't have that violent aspect of it in ordinary language ... like beating somebody up or putting a gun in their face."

Kavanaugh then cited a 2015 opinion written by the late Justice Antonin Scalia that turned on whether there was "a substantial degree of force" involved. If so, that would qualify as a violent felony, he suggested.

Over the two hours, Kavanaugh asked at least a dozen questions. The justices did not sound split along ideological lines. Instead, all of them said they were seeking a legal formula for meshing the 1986 federal law with the wide range of state felony laws.

In a second case, United States vs. Sims, a lawyer for Jason Sims, an Arkansas man, argued that breaking into an unoccupied recreational vehicle should not qualify as a violent felony. In the past, judges have ruled that breaking into a home counts as a violent crime, but not breaking into a vehicle.

Stanford law professor Jeffrey Fisher, who was appointed to represent Sims, said the court should continue to draw a line between burglaries of homes and vehicles, including RVs. Home burglaries are the more serious crimes because there is greater chance they could result in injuries and violence. By contrast, breaking to a vehicle is far less likely to result in violence, he said. And if so, the criminal will be charged with assault or robbery and get a longer prison term, he said.

Kavanaugh said he was not impressed with the argument that the defendant had not been given proper notice that a harsher penalty was possible. "I think if you are convicted three times of breaking into an RV, you should be on some notice that you shouldn't be possessing a firearm under federal law," he said.

On Wednesday, the court will hear a major immigration case in which Kavanaugh could hold the deciding vote. It pits the American Civil Liberties Union against the Trump administration and arose from a class-action lawsuit in California. At issue is whether legal immigrants who have a past crime on their record, including drug possession, can be detained for deportation by immigration authorities _ even long after they've served their time for the crime _ and held in jail without a bond hearing.

The federal immigration law says the government "shall take into custody any alien" with certain crimes on their record "when the alien is released."

The ACLU sued on behalf of lawful noncitizens such as Eduardo Padilla, who came to the United States in 1966 as an infant and became a lawful permanent resident in the Sacramento area. He has five children and six grandchildren, all of whom are U.S. citizens. Padilla had two convictions for drug possession in 1997 and 1999 and served 90 days in jail in 2002 for having an unloaded pistol in a shed.

In 2013, federal agents arrested him for those past crimes and held him in jail for deportation. But the 9th U.S. Circuit Court of Appeals said the "mandatory detention" provision did not apply to immigrants such as Padilla who were released years ago. He was released on a $1,500 bond because a judge decided he did not present a danger and was not likely to flee.

However, in Nielsen vs. Preap, the administration is urging the court to overturn the 9th Circuit and uphold mandatory detention for "criminal aliens," even if they have served time for their crimes years ago.