America's highest court has thrown out key provisions of border state Arizona's harsh crackdown on immigrants, one of the most divisive domestic issues separating president Barack Obama from his Republican challenger Mitt Romney.
While finding much of the Arizona law unconstitutional, the Supreme Court did say that one part would stand - the portion requiring police to check the status of someone they suspect is not in the United States legally. Even there, though, the justices said the provision could be subject to additional legal challenges.
The decision upholds a "show me your papers" provision for the moment. But it takes the teeth out of it by prohibiting police officers from arresting people on minor immigration charges.
Justice Anthony Kennedy wrote the opinion for the court that was unanimous on allowing the status check to go forward. The court was divided on striking down the other portions.
The ruling weakens the drive by Republicans, especially the most conservative in the party, who want to make it more difficult for immigrants who are in the country illegally.
Mr Romney took a tough stand on immigration in the early days of his campaign for the party's nomination, but, with his place on the presidential ballot all but assured, he has sought to find a more moderate position.
That shift was forced on him after Mr Obama issued an executive order earlier this month that ends deportation of young people who were brought into the country illegally by their parents.
That gave him a major boost with already-friendly Hispanic voters, a powerful voting bloc in what looks to be one of the closest presidential races in recent US history.