The court upheld the "show me your papers" requirement, but even there the justices said the provision could be subject to additional legal challenges. And they removed some teeth by prohibiting officers from arresting people on immigration charges.
The Obama administration had assailed the Arizona law as an unconstitutional intrusion into an area under Washington's control, and the court struck down provisions that would have made state crimes out of federal immigration violations.
But several lawmakers and civil rights groups said the part of the law left in place by the high court was an invitation to racial profiling.
The court announced that Thursday would be the last day of rulings this term, which means the decision on President Barack Obama's landmark health care overhaul probably will come that day.
The Arizona decision landed in the middle of a presidential campaign in which Obama has been heavily courting Latino voters and Republican challenger Mitt Romney has been struggling to win Latino support. During a drawn-out primary campaign, Romney and the other GOP candidates mostly embraced a hard line on illegal immigrants, though Romney has lately taken a softer tone.
Obama said he was pleased that the court struck down key parts of Arizona's law but concerned about what the high court left intact.
"No American should ever live under a cloud of suspicion just because of what they look like," the president said in a written statement. He said police in Arizona should not enforce the provision in a way that undermines civil rights.
"What this decision makes unmistakably clear is that Congress must act on comprehensive immigration reform," Obama said.
Romney did not immediately comment on the court decision Monday, but he said, "I believe that each state has the duty - and the right - to secure our borders and preserve the rule of law, particularly when the federal government has failed to meet its responsibilities."
In Monday's decision, the court was unanimous on allowing the immigration status check to go forward. The justices were divided on striking down the other portions.
Justice Anthony Kennedy said the law could - and suggested it should - be read to avoid concerns that status checks could lead to prolonged detention.
The court struck down these three major provisions: requiring all immigrants to obtain or carry immigration registration papers, making it a state criminal offense for an illegal immigrant to seek work or hold a job and allowing police to arrest suspected illegal immigrants without warrants.
Arizona Gov. Jan Brewer said the ruling marked a victory for people who believe in the responsibility of states to defend their residents. The case, she said, "has always been about our support for the rule of law. That means every law, including those against both illegal immigration and racial profiling. Law enforcement will be held accountable should this statute be misused in a fashion that violates an individual's civil rights."
Civil rights groups that separately challenged the law over concerns that it would lead to rights abuses said their lawsuit would go on.
Even with the limitations the high court put on Arizona, the immigration status check still is "an invitation to racial profiling," said American Civil Liberties Union lawyer Omar Jadwat.
The Obama administration sued to block the Arizona law soon after its enactment two years ago. Federal courts had refused to let the four key provisions take effect.
Five states - Alabama, Georgia, Indiana, South Carolina and Utah - have adopted variations on Arizona's law. Parts of those laws also are on hold pending the outcome of the Supreme Court case.
Chief Justice John Roberts and Justices Stephen Breyer, Ruth Bader Ginsburg and Sonia Sotomayor joined all of Kennedy's opinion.
Justices Antonin Scalia and Clarence Thomas would have allowed all the challenged provisions to take effect. Justice Samuel Alito would have allowed police to arrest undocumented immigrants who seek work, and also make arrests without warrants.
Scalia, in comments from the bench, caustically described Obama's recently announced plans to ease deportation rules for some children of illegal immigrants.
"The president said at a news conference that the new program is 'the right thing to do' in light of Congress' failure to pass the administration's proposed revision of the Immigration Act. Perhaps it is, though Arizona may not think so. But to say, as the court does, that Arizona contradicts federal law by enforcing applications of the Immigration Act that the president declines to enforce boggles the mind," Scalia said.
The Arizona case focused on whether states can adopt their own measures to deal with an estimated 11 million illegal immigrants in the face of federal inaction on comprehensive reform, or whether the federal government has almost exclusive authority in that area.
Kennedy wrote obliquely about the impasse at the national level.
"Arizona may have understandable frustrations with the problems caused by illegal immigration while that process continues, but the state may not pursue policies that undermine federal law," Kennedy said.
Justice Elena Kagan sat out the case because of her work in the Obama administration.
The case is Arizona v. U.S., 11-182.
Associated Press writer Jacques Billeaud in Phoenix contributed to this report.