Forget racial profiling or Arizona Governor Jan Brewer’s feud with President Obama. In striking down key provisions of SB 1070, the controversial Arizona law aimed at illegal immigration, the Supreme Court was refereeing a dispute about federalism. With Elena Kagan recusing herself because she worked on the case as solicitor general, the Supreme Court voted 5-3, mostly siding with the Obama Administration to affirm its broad powers and unambiguously ruling that Arizona can’t make immigration laws that supersede existing federal statutes.

In a majority opinion authored by swing vote Anthony Kennedy, who was joined by conservative Chief Justice John Roberts and liberals Stephen Breyer, Sonia Sotomayor and Ruth Ginsburg, the court held that federal law pre-empted three of the four main tenets of SB 1070. Arizona cannot make living there without documentation a state crime with its own penalties, even though it’s already a violation of federal statute, Kennedy wrote. “Section 3 intrudes on the field of alien registration, a field in which Congress has left no room for states to regulate.”

Similarly, the court found that the state’s penalties against undocumented workers violate the federal government’s exclusive control over that issue, and that Arizona law enforcement cannot arrest people whom they reasonably suspect to have committed a deportable offense without a warrant. “As a general rule, it is not a crime for a removable alien to remain in the U.S.,” Kennedy wrote. “The federal scheme instructs when it is appropriate to arrest an alien during the removal process.” In other words: federal discretion is paramount. The law, Kennedy made clear, would’ve allowed Arizona to punish undocumented immigrants the federal government does not want to see penalized. That is “not the system Congress created,” according to the court.

The lone untouched pillar of the law, however, is its most controversial and well known. Dubbed the “papers, please” clause, this part of SB 1070 requires state law-enforcement officers to check immigration status during routine detentions and allows them to stop people they suspect to be undocumented. At its core, this part of the law only requires state law enforcement to report immigration violations to federal authorities and does not prescribe any punitive action. “Congress has done nothing to suggest it is inappropriate to communicate with ICE in these situations,” Kennedy wrote. As long as the measure is carried out under the civil rights protections written into the law, he found no constitutional objections. Notably, the liberal wing of the court registered no dissent on this point.

Neither did the conservative wing, but that’s where their agreement ended. Justices Samuel Alito, Clarence Thomas and Antonin Scalia wrote three biting dissents arguing against the majority and the federal government. Thomas opined briefly that the whole law should stand, and Alito spliced an already split decision by dissenting on warrantless arrests and employment penalties while agreeing with the majority on the rest. But these objections were tame in comparison with Scalia’s dissent, which like Thomas’, held that the whole law should stand.

According to its authors, the federal government’s failure to solve Arizona’s illegal-immigration problem was the impetus for SB 1070. Scalia pummeled this point throughout, repeatedly charging the Obama Administration with dereliction of duty while arguing that the law was simply a case of a sovereign state protecting itself. “The government complains that state officials might not heed ‘federal priorities,'” he wrote. “Indeed they might not, particularly if those priorities include willful blindness or deliberate inattention to the presence of removable aliens in Arizona.” Scalia also used the opportunity to rail against Obama’s directive, issued earlier this month, to waive deportation for hundreds of thousands of young undocumented immigrants. “Thousands of Arizona’s estimated 400,000 illegal immigrants — including not just children but men and women under 30 — are now assured immunity from enforcement and will be able to compete openly with Arizona citizens for employment,” he wrote. “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.”

Despite Scalia’s unconcealed vitriol, proponents of the law claimed victory when the decision was announced on Monday. “Today’s decision by the U.S. Supreme Court is a victory for the rule of law,” Governor Brewer said. Her opponents claimed the ruling as a victory of their own. Obama said he was “pleased” by the ruling, albeit “concerned” by the remaining status-check measure. Even the press was confused in the ruling’s aftermath, with some major outlets calling SB 1070 “overturned” and others proclaiming it “upheld.” The confusion reflected the muddled state of immigration law in the U.S., both before and after the Supreme Court weighed in.