For years to come, Sheriff Joe Arpaio can expect to have a federal judge looking over his shoulder, watching almost his every move and those of his deputies.

A federal judge Wednesday approved a plan to place an independent monitor inside the Maricopa County, Ariz., Sheriff's Office to ensure the department is not racial profiling.

Maricopa County deputies - once described by a Justice Department expert as conducting "the most egregious racial profiling in the United States" - will have every traffic stop monitored statistically and with video cameras, with strict orders to ignore suspects' race.

U.S. District Judge G. Murray Snow's ruling caps a class-action anti-discrimination lawsuit against Arpaio and the sheriff's office. In May, Snow ruled that Arpaio's office was using unconstitutional racial profiling to target and detain Latinos suspected to have entered the U.S. illegally.

The latest ruling orders the sheriff's office to promote an internal policy "that unauthorized presence in the United States is not a crime and does not itself constitute reasonable suspicion or probable cause to believe that a person has committed or is committing any crime."

Deputies making stops will have to make a radio call specifying what the stop is about. They are barred from asking someone about immigration status unless the person is suspected of a crime.

Snow ruled that the court would maintain the monitorship until the sheriff's office had achieved "full and effective compliance" for at least three years. The sheriff's office and the plaintiffs - Latinos who said they were profiled by deputies - were expected to agree on the monitor, who will be appointed by the judge to oversee the department.

The American Civil Liberties Union of Arizona, which filed suit against the sheriff's office, will have access to department data and materials and will receive reports about the department's progress on implementing new training and anti-discrimination policies.

"Every person in Maricopa County deserves better than a sheriff’s department that commits pervasive civil rights violations at the expense of public safety," Cecillia Wang, director of the ACLU Immigrants’ Rights Project, said in a statement. "The court’s order will make sure the agency actually enforces the law and will no longer go on wild goose chases based on racial stereotypes."

The sheriff's office's attorney, Tim Casey, told the Arizona Republic that the department expected to appeal Snow's decision but would abide by the order.

"The sheriff still remains in exclusive charge of the [sheriff's office], he still sets the policy, still sets the programs and makes the sole decision on discretionary items," Casey told the Republic. "The monitor has absolutely no veto power whatsoever on any law enforcement decision."