Both sides claim victory after Supreme Court rules on Arizona immigration law

President Barack Obama and some of his top Democratic allies in Congress claimed victory Monday after the Supreme Court struck down key parts of a controversial Arizona law aimed at curbing undocumented immigration. But the justices' 5-3 ruling gave Republicans something to cheer by letting stand—for now—a core provision that allows police to check the immigration status of someone they stop. After the ruling, both sides touted the decision as a win.

[Join national affairs reporter Liz Goodwin at 4 p.m. ET for a Facebook discussion of why the court allowed parts of the Arizona law to stand.]

"I am pleased that the Supreme Court has struck down key provisions of Arizona's immigration law," Obama said in a statement. "What this decision makes unmistakably clear is that Congress must act on comprehensive immigration reform. A patchwork of state laws is not a solution to our broken immigration system—it's part of the problem."

Meanwhile, Arizona Gov. Jan Brewer immediately applauded the court's ruling as "a victory for the rule of law" and a "loss" for opponents of her state's approach. Brewer said police engaged in racial profiling would be punished.

"I am confident our officers are prepared to carry out this law responsibly and lawfully. Nothing less is acceptable," she said, noting that foes of the measure are sure to challenge it in court again if it is enforced unfairly.

The president said he was "concerned about the practical impact" of what critics have dubbed the "papers, please" provision. "We must ensure that Arizona law enforcement officials do not enforce this law in a manner that undermines the civil rights of Americans," he said.

Polls show immigration far behind the sputtering economy on the list of worries most pressing on voters' minds. But Obama has highlighted his approach to the issue as he steps up his efforts to win over and energize Latinos, a critical part of the coalition that powered his historic 2008 campaign. The president is expected to crush Mitt Romney among Latino voters, who could decide the outcome in a handful of critical battleground states.

Romney, who was due to attend a fundraiser in Arizona, said in a statement that the ruling highlighted the need for "a national immigration strategy" and accused Obama of having "failed to provide any leadership on immigration."

"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," Romney said, essentially contradicting the high court's findings. Justice Anthony Kennedy, writing in the majority opinion, declared that the federal government's "power to determine immigration policy is well settled." He went on: "Arizona may have under­standable frustrations with the problems caused by illegal immigration while that process continues, but the State may not pursue policies that undermine federal law."

Later, Romney said in Phoenix that "given the failure of the immigration policy in this country," he "would have preferred to see the Supreme Court give more latitude to the states not less."

"It's become a muddle. But it didn't have to be this way," Romney said, according to a pool report of his remarks, charging that Obama had "failed to lead" on the issue and that states and local government had tried to fill the resulting vacuum.

Democratic Senate Majority Leader Harry Reid hailed the court's decision, calling the Arizona law "not just ill-advised but also unconstitutional," and blamed Republicans for stalling efforts to overhaul what all sides agree is a broken immigration system. Reid also took a big whack at Romney.

"It is disturbing that Mitt Romney called the unconstitutional Arizona law a 'model' for immigration reform," he said, referring to the Republican candidate's comments in a Feb. 22 debate. "Laws that legalize discrimination are not compatible with our nation's ideals and traditions of equal rights, and the idea that such an unconstitutional law should serve as a 'model' for national reform is far outside the American mainstream."

(Asked in that debate about Arizona's tough approach, Romney had pledged to drop federal lawsuits against states that take similar approaches. But aides said that his description of the state as a "model" referred to its use of E-Verify, a federal database employers can use to check work eligibility.)

Arizona's Republican senators, John McCain and Jon Kyl, said in a joint statement that they would "fully review" the ruling but vowed to keep fighting "to secure our southern border" and accused Obama of enforcing immigration rules "based on a political agenda, not the laws as written by Congress."

"We believe Arizonans are better served when state and federal officials work as partners to protect our citizens rather than as litigants in a courtroom," the senators said.

"I will work with anyone in Congress who's willing to make progress on comprehensive immigration reform that addresses our economic needs and security needs, and upholds our tradition as a nation of laws and a nation of immigrants," Obama said. "And in the meantime, we will continue to use every federal resource to protect the safety and civil rights of all Americans, and treat all our people with dignity and respect."

Romney has struggled with immigration on the campaign trail: He said he would veto the DREAM Act if it passed when he was president. In a speech last week to Latino officials, he said he would offer a long-term solution that would "replace and supersede" Obama's decision to halt deportations of some 800,000 young undocumented immigrants brought to U.S. soil as children. But details of his plan remained vague.

The Republican base is fiercely anti-undocumented immigration. The Obama administration has carried out a record number of deportations—but conservatives accuse him of lax enforcement of the country's immigration laws.

Rick Santorum, who challenged Romney from the right, said in a statement on the court's ruling that "it's time for the federal government to step up to its constitutional responsibility to secure our borders, enforce our immigration laws fairly, and to partner with states rather than sue them to accomplish this important objective."

Democratic Sen. Chuck Schumer said the Supreme Court had delivered "a stern warning" to Arizona regarding the implementation of that provision.

And "this decision tells us that states cannot take the law into their own hands," he said in a statement. "The only real solution to immigration reform is a comprehensive federal law."