Police officers in Arizona are allowed to check the immigration status of every person who is stopped or arrested, the Supreme Court ruled this morning.

But the court struck down other key parts of the law, signaling a victory for the federal government in its authority over immigration law.

The controversial immigration measure passed in Arizona two years ago and has been opposed by President Obama.

Stephen Vladeck, of American University Washington College of Law, said the ruling was a victory for the federal government.

"Today's decision is a sweeping victory for the federal government because it strikes down three of the four key provisions of SB 1070 and leaves the fourth on life support," he said. "In effect, Arizona had sought to make it state policy that being undocumented is itself illegal. Today, the Supreme Court not only rejected that view, but in the process likely put the brakes on a series of analogous efforts underway in other states across the country. Reasonable people may disagree about the right answers to immigration policy. What today's decision makes clear is that this is a debate for Congress, not for 50 different state legislatures."

Justice Anthony Kennedy wrote that the policy could interfere with federal immigration law, but that the court couldn't assume that it would.

"The Federal Government has brought suit against a sovereign State to challenge the provision even before the law has gone into effect," Kennedy wrote. "There is a basic uncertainty about what the law means and how it will be enforced."

The law — known as SB 1070 — was signed into law by Gov. Jan Brewer in April 2010, but immediately challenged by the Obama administration. A lower court sided with the administration and agreed to prevent four of the most controversial provisions from going into effect.

Want more off-the-cuff politics? Check out OTUS on Facebook and follow us on Twitter @OTUSNews.

Provisions that were struck down included the criminalization of unauthorized work, failing to carry immigration papers and allowing warrantless arrests when an officer had probable cause to believe a person has committed an offense that would result in deportation. Finally, the court voided a provision that made it a crime for undocumented immigrants to be in Arizona or seek work in the state.

In a statement, Brewer ignored the thrust of the court's decision against the provisions it deemed unconstitutional, and insisted that the court had upheld the "heart" of the law, which allows the police to check people's immigration papers. She said that officers "will be held accountable should this statute be misused in a fashion that violates an individual's civil rights."

Some opponents of the key provision weren't celebrating even as the other parts of the law were struck down.

"SB 1070, even with some provisions removed, threatens to tear families apart and create a dangerous level of mistrust between law enforcement and women immigrants who fear detention," Miriam Yeung, the head of the National Asian Pacific American Women's Forum, which pushes for immigrants' rights, said in a statement. "By upholding one of the most harmful provisions of the law, the U.S. Supreme Court has set a dangerous precedent."

Justice Antonin Scalia targeted Obama in a 22-page dissent.

"The president said at a news conference that the new program is 'the right thing to do' in light of Congress's failure to pass the administration's proposed revision of the Immigration Act," the Reagan appointee wrote. "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."

Larry Dever, a county sheriff in Arizona who supports the most controversial part of the law, said, "While this is not a total win, it is a partial victory for sheriffs, who are constitutional officers, and confirms we have the authority to inquire of the legal status of people we think are here illegally."

In court Solicitor General Donald B. Verrilli Jr. argued that the Constitution gives the federal government authority over immigration control and that the Arizona law interfered with existing federal law.

Verrilli said that while the federal government welcomes the assistance of state officers, Arizona is trying to adopt its own immigration policy while paying no heed to the Immigration and Nationality Act (INA), the principal federal immigration statute that establishes the scheme for the regulation of immigration.

But Paul Clement, arguing on behalf of Arizona, argued that the law was passed because states are frustrated with the federal government's efforts to curb illegal immigration. Clement said that the Arizona law was drafted to cooperate with existing federal law.

Obama's allies argue that the element of the law that was upheld is the first step in enforcing laws based on race.

"This 'papers please' provision will directly lead to racial and ethnic profiling based on the way people look or the way they speak, regardless of whether they have been American citizens all of their lives," said Angela Maria Kelley, the vice president for immigration policy at the Center for American Progress Action Fund. "The Supreme Court's decision today will be a watershed moment in the history of American immigration policy, but we believe it will be the beginning of a movement toward the basic American principle of greater inclusivity, rather than the repudiation of it."