Image caption The Supreme Court was unanimous in upholding what has been called the "check your papers" provision, but struck down three other parts of the bill

The US Supreme Court has backed checks on the immigration status of people stopped or arrested in Arizona, while striking down key parts of a tough law critics branded as racial profiling.

President Barack Obama said he was pleased three challenges were upheld .

But Arizona Governor Jan Brewer said the "heart" of the law would remain.

President Obama and his Republican rival Mitt Romney are each battling for Hispanic votes ahead of November's presidential election.

Mr Romney reacted quickly to the court's ruling, criticising Mr Obama for not passing a national immigration reform law.

In a statement, he said each US state has "the duty - and the right - to secure our borders and preserve the rule of law".

President Barack Obama later said he was "pleased" that some parts of the law had been thrown out by the court.

It is not likely that Thursday's ruling will be quite so open to interpretation about who has won, although the aftershocks are much harder to predict

But he added: "I remain concerned about the practical impact of the remaining provision of the Arizona law that requires local law enforcement officials to check the immigration status of anyone they even suspect to be here illegally.

"No American should ever live under a cloud of suspicion just because of what they look like."

In other developments at the court on Monday:

A ruling on President Obama's landmark healthcare reform law was scheduled for Thursday

The justices rejected mandatory sentencing of juveniles convicted of murder to life in prison without parole

The court struck down a Montana campaign finance law that would limit corporate contributions to political campaigns.

'Held accountable'

The Supreme Court judgement came after the US government argued that the law infringed on federal rights to oversee immigration policy.

Alabama, Georgia, Indiana, South Carolina and Utah have all adopted variations of the Arizona law.

The headline provision, known as Section 2(B), that requires police to make a "reasonable attempt... to determine the immigration status" of anyone who is stopped for another violation, was upheld by the Supreme Court.

Media playback is unsupported on your device Media caption Jan Brewer: We "fully expect" challenges

The court ruled it was too early to tell whether the clause caused a conflict with federal laws, but added that the provision could be open to legal challenge again at a later date.

The Supreme Court also struck down three other parts of the Arizona immigration law.

One clause would have required immigrants to carry proof of their status with them, and another would have made it a crime for undocumented workers to apply for a job.

The court also struck down a provision that would have allowed police to stop people purely on the suspicion that they were in the country illegally.

Justice Anthony Kennedy, who wrote the opinion for the court, said the justices were unanimous in their decision to allow the "check your papers" provision to come into effect. The court was divided on other issues.

One justice, Antonin Scalia, who dissented from the case, said he would uphold all parts of the Arizona law, citing the sovereignty of individual states as defined in the US constitution.

Arizona's Republican Governor, Jan Brewer, called the court's ruling a victory, saying the "heart" of the bill could now come into effect.

In a statement , Ms Brewer said the ruling was a victory for "all Americans who believe in the inherent right and responsibility of states to defend their citizens.

But she added: "Law enforcement will be held accountable should this statute be misused in a fashion that violates an individual's civil rights."

Other reaction to the law was nuanced, and at least partly open to interpretation: some claimed victory for backers of the law, while others saw the ruling as a partial victory for the administration.

Immigration has become a key issue as the US edges closer to this year's presidential election.

Mr Obama recently outlined a plan to allow hundreds of thousands of illegal immigrants who came to the US as children the option of legal status and work permits.

Mr Romney has opposed Mr Obama's plan, but has not said how he would address the issue of immigration.

Both men are courting Hispanic votes ahead of their showdown in November.

What does the Supreme Court ruling mean?

The National Journal called the Supreme Court's ruling a victory for the government. Although conservatives hoped for a full endorsement of the law, "instead, Arizona got permission to do what local police officers all over the country already do on an ad hoc basis", Fawn Johnson wrote .

But Politico's Josh Gerstein said the decision leaves open the possibility of further litigation. It cleared "the way for similar legislation to take effect in other states and potentially angering Latinos in a way that could give President Barack Obama an added boost from Hispanic voters in November", he wrote.

Writing for the Washington Post, Greg Sargent says the Supreme Court has upheld the most troubling clause in the law, warning that it "could become a permanent feature of the American legal landscape - with untold consequences when it comes to possible racial profiling and other potential abuses".

However, Jess Bravin and Miriam Jordan wrote in the Wall Street Journal that the court delivered "a ruling that gave both sides something to cheer in advance of November elections where immigration is a major issue".