A federal judge ruled Friday that the office of America’s self-proclaimed toughest sheriff systematically singled out Latinos in its trademark immigration patrols, marking the first finding by a court that the agency racially profiles people.

The 142-page decision by U.S. District Judge Murray Snow in Phoenix backs up allegations that Maricopa County Sheriff Joe Arpaio’s critics have made for years that his officers rely on race in their immigration enforcement.

Snow, whose ruling came more than eight months after a seven-day non-jury trial on the subject, also ruled Arpaio’s deputies unreasonably prolonged the detentions of people who were pulled over.

A small group of Latinos alleged in a lawsuit that Arpaio’s deputies pulled over some vehicles only to make immigration status checks. The group asked Snow to issue injunctions barring the sheriff’s office from discriminatory policing, and the judge ruled that more remedies could be ordered in the future.

The sheriff won’t face jail time or fines as a result of the ruling.

The group also accused the sheriff of ordering some immigration patrols not based on reports of crime but rather on letters and emails from Arizonans who complained about people with dark skin congregating in an area or speaking Spanish. The group’s attorneys pointed out that Arpaio sent thank-you notes to some people who wrote the complaints.

The sheriff has repeatedly denied the allegations, saying that his deputies only stop people when they think a crime has been committed and that he wasn’t the person who picked the location of the patrols. His lawyers also said there was nothing wrong with the thank-you notes.

The ruling represents a victory for those who pushed the lawsuit. They weren’t seeking money damages but rather a declaration that Arpaio’s office racially profiles and an order that requires it to make policy changes.

Stanley Young, the lead lawyer who argued the case against Arpaio, said he was still reading the decision Friday afternoon but was happy that the court ruled the sheriff violated the constitutional rights of Latinos.

He said the decision contained “very detailed findings of discriminatory intent and effect.”

Young said Snow set a hearing for June 14 where he will hear from the two sides on how to make sure the orders in the ruling are carried out.

Tim Casey, Arpaio’s lead attorney, declined comment until after he had read Snow’s decision.

Arpaio, who turns 81 next month, was elected in November to his sixth consecutive term as sheriff in Arizona’s most populous county.

Known for jailing inmates in tents and making prisoners wear pink underwear, Arpaio started doing immigration enforcement six years as Arizona voters grew frustrated with the state’s role as the nation’s busiest illegal entryway.

Snow wrote that “in the absence of further facts that would give rise to reasonable suspicion or probable cause that a violation of either federal criminal law or applicable state law is occurring,” Arpaio’s office now is enjoined from enforcing its policy “on checking the immigration status of people detained without state charges, using Hispanic ancestry or race as any factor in making law enforcement decisions pertaining to whether a person is authorized to be in the country, and unconstitutionally lengthening stops.”

Snow added that “the evidence introduced at trial establishes that, in the past, the MCSO has aggressively protected its right to engage in immigration and immigration-related enforcement operations even when it had no accurate legal basis for doing so.”