“You can see it’s not selling very well,” Justice Sonia Sotomayor, a member of the court’s liberal wing and its first Hispanic justice, told Solicitor General Donald B. Verrilli Jr., referring to a central part of his argument against the measure.

Mr. Verrilli, representing the federal government, had urged the court to strike down a provision requiring state law enforcement officials to determine the immigration status of people they stop and suspect are not in the United States legally.

It was harder to read the court’s attitude toward three other provisions of the law at issue in the case, including one that makes it a crime for illegal immigrants to work. The court’s ruling, expected by June, may thus be a split decision that upholds parts of the law and strikes down others.

A ruling to uphold the law would be a victory for conservatives who have pressed for tough measures to stem illegal immigration, including ones patterned after the Arizona law, in Alabama, Georgia, Indiana, South Carolina and Utah. President Obama has criticized the Arizona law, calling it a threat to “basic notions of fairness.”

Should the court uphold any part of the law, immigration groups are likely to challenge it based on an argument that the court was not considering on Wednesday: that the law discriminates on the basis of race and ethnic background.

Indeed, Chief Justice John G. Roberts Jr. signaled that the court was not closing the door on such a challenge, making clear that the case, like last month’s arguments over Mr. Obama’s health care law, was about the allocation of state and federal power. “No part of your argument has to do with racial or ethnic profiling, does it?” he asked Mr. Verrilli, who agreed.

Photo

Jan Brewer, governor of Arizona, walked through protesters outside the Supreme Court in Washington on Wednesday.Credit
Doug Mills/The New York Times

Wednesday’s argument, the last of the term, was a rematch between the main lawyers in the health care case. Paul D. Clement, who argued for the 26 states challenging the health care law, represented Arizona. Mr. Verrilli again represented the federal government. In an unusual move, Chief Justice Roberts allowed the argument to go 20 minutes longer than the usual hour.

The two lawyers presented sharply contrasting accounts of what the Arizona law meant to achieve.

Mr. Clement said the state was making an effort to address a crisis by passing a law that complemented federal immigration policy. “Arizona borrowed the federal standards as its own,” he said, adding that the state was simply being more assertive in enforcing federal law than the federal government. Mr. Verrilli countered that Arizona’s approach was in conflict with the federal efforts. “The Constitution vests exclusive authority over immigration matters with the national government,” he said.

Mr. Verrilli, whose performance in the health care case was sometimes halting and unfocused, seemed on Wednesday occasionally to frustrate justices who might have seemed likely allies. At one point Justice Sotomayor, addressing Mr. Verrilli by his title, said: “General, I’m terribly confused by your answer. O.K.? And I don’t know that you’re focusing in on what I believe my colleagues are trying to get to.”

The Arizona law advances what it calls a policy of “attrition through enforcement.” The Obama administration sued to block the law, saying it could not be reconciled with federal laws and policies. In legal terms, the case is about whether federal law “pre-empts,” or displaces, the challenged state law.

As a general matter, federal laws trump conflicting state laws under the Constitution’s supremacy clause. But no federal law bars the challenged provisions of the Arizona in so many words, and the question for the justices is whether federal and state laws are in such conflict that the state law must yield.

Most of the argument on Wednesday concerned the part of the law requiring state officials to check immigration status. Several justices said states were entitled to enact such provisions, which make mandatory inquiries to federal authorities from local police officers that are already commonplace.

Chief Justice Roberts said the state law required merely that the federal government be informed of immigration violations and left enforcement decisions to it. “It seems to me that the federal government just doesn’t want to know who is here illegally or not,” he said.

Video

TimesCast | Immigration at Highest Court

Justice Stephen G. Breyer suggested that he would be prepared to uphold the provision if the process of checking immigration status would not result in “detention for a significantly longer time” than in the ordinary case.

The law also makes it a crime under state law for immigrants to fail to register under a federal law and for illegal immigrants to work or to try to find work. Federal law penalizes employers who hire illegal workers but does not punish employees for working.

Chief Justice Roberts indicated the employment provision of the state law was vulnerable. “That does seem to expand beyond the federal government’s determination about the types of sanctions that should govern the employment relationship,” he said.

Mr. Verrilli urged the court to consider the Arizona law against the backdrop of the foreign policy considerations that arise from taking actions against citizens of other nations.

“So we have to enforce our laws in a manner that will please Mexico?” Justice Antonin Scalia responded.

Last year, in Chamber of Commerce v. Whiting, the Supreme Court held that a different Arizona law, this one imposing harsh penalties on businesses that hire illegal workers, was not pre-empted by federal law. The vote was 5 to 3, and it split along ideological lines.

Chief Justice Roberts, writing for four of the justices in the majority, said the state law under review “simply seeks to enforce” a federal ban on hiring illegal workers. “Arizona went the extra mile,” he wrote last year, “in ensuring that its law closely tracks” the federal one. On Wednesday, he suggested that the Whiting decision was the most apt precedent.

Justice Elena Kagan disqualified herself from both the Whiting case and the one concerning the newer law, Arizona v. United States, No. 11-182, presumably because she had worked on them as solicitor general.

Toward the end of the argument, Justice Sotomayor spent some time quizzing Mr. Verrilli about how officials checked databases to see if someone was in this country legally. “Today,” she said, reflecting on the matter, “if you use the names Sonia Sotomayor, they would probably figure out I was a citizen.”

A version of this article appears in print on April 26, 2012, on page A1 of the New York edition with the headline: Arizona Law: Justices Seem To Favor Core. Order Reprints|Today's Paper|Subscribe