PHOENIX — A federal judge ruled on Friday that Sheriff Joe Arpaio and his deputies had violated the constitutional rights of Latinos by targeting them during raids and traffic stops here and throughout Maricopa County.

With his ruling, Judge G. Murray Snow of United States District Court delivered the most decisive defeat so far to Sheriff Arpaio, who has come to symbolize Arizona’s strict approach to immigration enforcement by making it the leading mission for many of the 800 deputies under his command at the Maricopa County Sheriff’s Office.

At 142 pages, the decision is peppered with stinging criticism of the policies and practices espoused by Sheriff Arpaio, who Judge Snow said had turned much of his focus to arresting immigrants who were in the country illegally, in most cases civil violations, at the expense of fighting crimes.

He said the sheriff relied on racial profiling and illegal detentions to target Latinos, using their ethnicity as the main basis for suspecting they were in the country illegally. Many of the people targeted were American citizens or legal residents.