AFTER A TWO-YEAR struggle, a federal judge this week authorized Arizona law enforcement agencies to require officers to check the immigration status of anyone they suspect is in the country illegally. Wearing the wrong clothes, speaking with the wrong accent or having the wrong skin color could land you in hot water in Arizona.

The state’s “show me your papers” provision — one of the most bitterly contested parts of the obnoxious immigration law enacted in 2010 — is the second such measure to receive a green light from federal courts. The first was from Alabama, where a similar policy was implemented about a year ago.

There, according to a recent report by the National Immigration Law Center, an immigrant advocacy group, law enforcement officers have created an “environment of racial profiling” that has encouraged private citizens to discriminate and abuse people they regard as foreign. The report, based on thousands of calls to a hotline, recounted instances of Hispanics, including legal residents, who were repeatedly stopped by police on flimsy pretexts and, in some cases, subjected to prolonged roadside detentions.

Arizona has a far larger population of Hispanics than Alabama does, including citizens, legal residents and illegal immigrants. Many of them have good reason to brace for similar treatment. Although the Supreme Court upheldArizona’s “show me your papers” provision, the justices warned that it could be struck down if it gave rise to a documented pattern of racial profiling or if it caused detentions to be prolonged. The Alabama case suggests that is highly likely.

Civil and immigrant-rights groups in Arizona are preparing to collect data they hope will provide the basis to challenge the law. Anecdotal evidence and even large numbers of pretextual traffic stops by police and sheriff’s offices will not suffice to prove that people were targeted for detention based on their race or appearance.

A more promising angle of attack may be to show that checking on detainees’ immigration status — a process that requires police to contact federal authorities — results in prolonged detentions, constitutionally barred as an unreasonable search and seizure. A number of prominent law enforcement officers, including the police chief of Tucson, have said the new immigration checks will inevitably delay routine traffic stops, turning them into ordeals.

And for what? Federal immigration authorities have made it clear they lack the resources to pick up and deport illegal immigrants if they are neither repeat offenders nor threats to public order or national security. The Arizona law, forced on the state by Republicans, is unlikely to result in increased deportations. The more probable outcome will be to deepen the climate of hostility for Hispanics, legal and illegal, in a state heavily dependent on them for its economic well-being.