Updated

A former Arizona sheriff is slated to go on trial Monday for allegedly disobeying a judge’s order to stop traffic patrols that targeted immigrants.

Former Maricopa County Sheriff Joe Arpaio, 85, faces a criminal charge stemming from his immigration enforcement actions. The eight-day trial in federal court in Phoenix will determine if the retired lawman is guilty of misdemeanor contempt of court for disobeying a judge’s 2011 order to stop racially profiling Latinos in traffic stops.

Arpaio’s legal troubles played a major role in voters pushing him out of office in November after a campaign in which he appeared alongside then-Republican presidential candidate Donald Trump at several rallies in Arizona.

ARIZONA GOVERNOR SEEKING MORE WILDFIRE FUNDING

The former six-term sheriff, who dubbed himself “America’s toughest sheriff,” has acknowledged defying the judge’s order in a racial profiling lawsuit by prolonging the patrols for months. But he insists it was not intentional. To win a conviction, prosecutors must prove he violated the order on purpose.

If convicted, Arpaio could face up to six months in jail, though lawyers who have followed his case doubt that a man of his age would be put behind bars.

Unlike other local police leaders who left immigration enforcement to U.S. authorities, Arpaio's department made hundreds of arrests in traffic patrols that sought out immigrants and business raids in which his officers targeted immigrants who used fraudulent IDs to get jobs.

His immigration powers were eventually stripped away by the courts and federal government, culminating with the 2013 ruling that Arpaio’s officers profiled Latinos.

BORDER PATROL RAIDS ARIZONA DESERT CAMPS THAT HELPS ILLEGAL IMMIGRANTS

Arpaio's defense centers around what his attorneys said were weaknesses in the court order that failed to acknowledge times when deputies would detain immigrants and later hand them over to federal authorities.

Arpaio’s attorney, Jack Wilenchik, said he is being charged with cooperating with U.S. immigration officials although the Trump administration encourages that.

This is really just a fight about immigration law and what it means," Wilenchik said. "And Arpaio is trying to do what a good cop does, which is to enforce the law."

Arpaio’s critics hope the case will bring long-awaited retribution for the sheriff who led crackdowns that divided immigrant families and escaped accountability. The judge concluded that Arpaio ignored the order because he believed his immigration tactics would help his 2012 campaign.

The TV interviews, news releases and tough talk about America’s border woes that Arpaio used over the years to boost his popularity are now being used against him in court.

Arpaio lost a request to prohibit prosecutors from mentioning comments he made about immigration during his last three campaigns.

It is not clear if Arpaio will testify.

The Associated Press contributed to this report.