The Supreme Court on Wednesday sharply questioned the Obama administration’s view of the limited roles states may play in enforcing immigration laws and seemed receptive to a central part of Arizona’s controversial crackdown on illegal immigrants.

Justices on both sides of the court’s ideological divide expressed skepticism that Arizona’s requirement that police check the immigration status of people they arrest or detain is an impermissible intrusion on Congress’s power to set immigration policy or the executive branch’s ability to implement it.

“You can see it’s not selling very well,” Justice Sonia Sotomayor told the federal government’s lawyer. Arizona’s attempt to alert federal authorities that a person may be in the country illegally does not force “you to change your enforcement priorities,” said Sotomayor, one of the court’s liberals and its first Hispanic member.

But the justices did question other aspects of the Arizona law, particularly provisions that make it a crime for an illegal immigrant to seek work and allow non-citizens to be arrested for not carrying documentation.

That raised the prospect of a split decision. And even if key parts of the law are upheld, future legal battles are inevitable as Arizona and other states attempt to implement tough legislation that civil rights groups say could violate constitutional rights.

Chanting protesters outside the court said that Arizona’s S.B. 1070 has created a climate of fear among the state’s mostly Latino immigrant population and that it will lead to racial and ethnic profiling. Gov. Jan Brewer (R), who has been closely identified with the law, emerged from the oral argument saying that she was “very, very” encouraged and that protesters were playing “the race card.”

It was a different scene — and a different emphasis — inside the courtroom.

Chief Justice John G. Roberts Jr. went out of his way to say that the court’s consideration of the law would not deal with those issues. Instead, the deliberations were a revival of the questions of federal power and states’ rights that marked last month’s historic arguments about President Obama’s health-care law.

“No part of your argument has to do with racial or ethnic profiling, does it?” Roberts asked Solicitor General Donald B. Verrilli Jr., who said no.

There could be little evidence that Arizona has implemented the law in a discriminatory way, because the Obama administration went to court to keep key provisions from taking effect.

The U.S. Court of Appeals for the 9th Circuit blocked provisions of the law that:

●Would require state and local law enforcement to verify the citizenship status of anyone stopped, detained or arrested when there is “reasonable suspicion” that the person is in the United States unlawfully.

●Would authorize law enforcement officials to make an arrest without a warrant when an officer has “probable cause to believe . . . the person to be arrested has committed any public offense that makes the person removable from the United States.”

●Would make it a state crime to be in the country unlawfully and require noncitizens to carry documents to prove they are here legally.

●Would make it a state crime for a person who is not lawfully in the country to work or seek work.

Arizona’s law has spawned similar efforts in Alabama, Georgia, Indiana, South Carolina and Utah; all have been challenged in court.

But Paul D. Clement, who was solicitor general in the George W. Bush administration, did his best to portray Arizona’s role as a cooperative partner with the federal government rather than a trendsetting challenger to lax enforcement of immigration laws.

“Arizona borrowed the federal standards as its own, and attempted to enlist state resources in the enforcement of the uniform federal immigration laws,” Clement said.

Sotomayor and Justices Stephen G. Breyer and Samuel A. Alito Jr. expressed concern about how long Arizona officers would be able to detain those suspected of being in the country illegally while trying to verify their status.

“Today, if you use the name Sonia Sotomayor, they would probably figure out I was a citizen,” Sotomayor said at one point, noting that there is no database of legal citizens. “But let’s assume it’s John Doe, who lives in Grand Rapids.”

The justices were far tougher in questioning Verrilli about how checking for citizenship status hurts the federal government’s authority.

“What the state is saying, ‘Here are people who are here in violation of federal law, you make the decision,’ ” Roberts said. “And if your decision is you don’t want to prosecute those people, fine, that’s entirely up to you.

“That’s why I don’t see the problem.”

Verrilli urged the court to look at the Arizona law as a whole, and its aim of “attrition through enforcement.” Such a policy shifts the problem of illegal immigration to other states and undermines the federal government’s goal of a cohesive policy.

Justice Antonin Scalia dismissed the argument. The federal government has the power to decide who belongs in the country, he said.

“But if, in fact, somebody who does not belong in this country is in Arizona, Arizona has no power?” he asked. “What does ‘sovereignty’ mean if it does not include the ability to defend your borders?”

Roberts suggested that the court already agreed that the states have a role in immigration enforcement in last term’s decision on a different Arizona law. Over the federal government’s objection, the court said the state could revoke the business licenses of employers who knowingly hired illegal workers.

But Verrilli had more luck with the court in objecting to the provisions of S.B. 1070 that make it a crime to seek work or to fail to register with the federal government. Neither actions are federal crimes, and Roberts told Clement that the work provision “does seem to expand beyond the federal government’s determination about the types of sanctions that should govern the employment relationship.”

Verrilli told the justices that Arizona’s criminal sanctions for illegal immigrants have international implications.

“You’re going to have a situation of mass incarceration of people who are unlawfully present,” he said. That “poses a very serious risk of raising significant foreign relations problems.”

How to deal with the nation’s estimated 11 million illegal immigrants is one of the country’s thorniest political issues and is playing an important role in the presidential contest.

Obama and his administration have been accused of not properly securing the nation’s borders and criticized for not delivering comprehensive immigration reform. Presumptive Republican presidential nominee Mitt Romney’s tough stance against illegal immigration has angered some interest groups and is said to have cost him support of increasingly influential Latino voters.

The case is Arizona v. United States . Justice Elena Kagan has recused herself because of her previous involvement in the case as Obama’s solicitor general.