The justices said Arizona’s police can stop, question and briefly detain immigrants if officers have reason to believe they are in the country illegally. This was seen as a key part of the state’s law.

But the justices said the police have limited authority. They must check with federal immigration agents before deciding to hold the suspects.

The justices also blocked parts of Arizona’s SB 1070 that would have made it a state crime for illegal immigrants to fail to carry documents or to seek work.

The court’s decision appears to give states such as Arizona a quite limited role in enforcing the laws against illegal immigrants. Their police can notify federal agents if they have a suspect in custody, but they cannot keep them in a county jail on state charges.