The US Supreme Court struck down three sections of Arizona’s tough immigration enforcement law on Monday but upheld its most controversial provision –requiring police to check the immigration status of individuals they have reason to suspect are illegal immigrants.

In a 5-to-3 decision, the high court ruled that three of the four challenged provisions of the Arizona statute, known as SB 1070, interfered with the US government’s enforcement of federal immigration law and thus must be struck down as preempted.

“The national government has significant power to regulate immigration,” Justice Anthony Kennedy said in the majority opinion. “Arizona may have understandable frustrations with the problems caused by illegal immigration…, but the state may not pursue policies that undermine federal law.”

In a dissent, Justice Antonin Scalia criticized the Obama administration’s selective enforcement of federal immigration laws.

“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,” Justice Scalia said. “The [Arizona] laws under challenge here do not extend or revise federal immigration restrictions, but merely enforce those restrictions more effectively,” he said.

Scalia also criticized President Obama’s June 15 decision to exempt from immigration enforcement some 1.4 million sons and daughters of illegal 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 said. “Arizona has moved to protect its sovereignty – not in contradiction of federal law,” Scalia said, “but in complete compliance with it.”

The decision is neither a clear victory nor a clear defeat for Mr. Obama. While the high court ruling reaffirms broad authority of the federal government to determine priorities for immigration enforcement, the justices nonetheless allowed the most controversial aspect of the law to remain in place.

The decision grants a green light to other states to adopt similar “show me your papers” provisions. But Justice Kennedy was careful to warn Arizona and other states about the real possibility of excesses during enforcement.

“There is a basic uncertainty about what the law means and how it will be enforced,” he wrote. “At this stage, without the benefit of a definitive interpretation from the state courts, it would be inappropriate to assume [the police check provision] will be construed in a way that creates conflict with federal law,” Kennedy said.

He added: “This opinion does not foreclose other preemption and constitutional challenges to the law as interpreted and applied after it goes into effect.”

In a statement, Mr. Obama said the inconclusive high court decision illustrated the continuing need for comprehensive immigration reform.

“A patchwork of state laws is not a solution to our broken immigration system – it’s part of the problem,” Obama said.

“I remain concerned about the practical impact of the remaining provision of the Arizona law,” he said. “Going forward, we must ensure that Arizona law enforcement officials do not enforce this law in a manner that undermines the civil rights of Americans.”

Arizona Gov. Jan Brewer (R) praised the Supreme Court decision as a victory for the rule of law, and for “all Americans who believe in the inherent right and responsibility of states to defend their citizens.”

She added: “After more than two years of legal challenges, the heart of SB 1070 can now be implemented in accordance with the US Constitution.”

The governor pledged to enforce the Arizona provision in an even-handed manner without resort to racial profiling or other unconstitutional methods. “Law enforcement will be held accountable should this statute be misused in a fashion that violates an individual’s civil rights,” she said.

The underlying legal challenge in the case, Arizona v. US (11-182), arose in 2010 shortly after state lawmakers passed the controversial measure.

In challenging the Arizona law, government lawyers argued that the tough measure conflicted with kinder, gentler enforcement priorities of the Obama administration. The administration sought to target criminals and repeat offenders who pose a danger to the public rather than the vast majority of the estimated 11 million illegal immigrants in the US.

Caught in a funnel of illegal immigration, human smuggling, and drug trafficking, Arizona officials adopted a different approach. SB 1070 sought “attrition through enforcement,” in an effort to encourage all illegal immigrants in the state to either go home, move to another state, or apply for legal status.

The administration sued the state to block implementation of the law.

Arizona defended SB 1070 as a legislative attempt by state officials to counteract what they viewed as lax federal enforcement of the nation’s borders and its immigration laws.

A federal judge in Phoenix agreed with the Obama administration, blocking four of the law’s provisions. A panel of the Ninth US Circuit Court of Appeals affirmed.

On Monday, the high court upheld the decision blocking enforcement of three of the four provisions.

Among those provisions, one made it a state crime for an undocumented immigrant to work in Arizona. Another required all noncitizens to carry at all times a federal registration card and made it a violation of Arizona law to fail to produce the document on demand.

The third provision authorized Arizona law enforcement officials to arrest an immigrant without a warrant when they have probable cause to believe the immigrant committed a deportable offense.

The upheld provision is the law’s most controversial measure, requiring state and local law enforcement officials to check immigration status during any lawful stop when police have reason to suspect the individual is in the US without legal authorization.

The case was heard by eight of the high court’s nine justices. The newest justice, Elena Kagan, did not participate in the case because she worked on the issue as Obama’s solicitor general prior to her nomination to the high court.

Voting with Justice Kennedy in the majority were Chief Justice John Roberts and Justices Ruth Bader Ginsburg, Stephen Breyer, and Sonia Sotomayor.

Dissents were filed by Justices Scalia, Clarence Thomas, and Samuel Alito.