Joe Arpaio, the sheriff of Arizona’s Maricopa County, was charged with criminal contempt of court on Tuesday, two weeks after the Department of Justice promised to file the charges. The sheriff is accused of ignoring a court injunction to halt traffic stops of motorists based on suspicion that they were in the country illegally.

Sheriff Arpaio, a beloved figure among conservative activists for his theatrical punishments of prisoners and immigration sweeps that were later deemed racial profiling by a federal judge, will not stand in court until a month after the Nov. 8 elections, when voters will decide whether they want to extend his 20-year-plus term as sheriff.

Arpaio's attorney Mel McDonald says that the sheriff will plead not guilty.

But the charges do little to help his struggling bid for reelection, at a time when demographic changes in the county are stacking the cards against him.

Latinos, who make up about 30 percent of the county’s population, historically have voted at rates that don’t reflect that proportion. But as that percentage grows, so does their electoral clout. Every month, 2,042 Latinos in Maricopa County turn 18, compared with 1,975 white residents, reported USA Today in September. Meanwhile, Phoenix and its suburbs are drawing an influx of younger, more affluent, and politically liberal voters from other US states, as The Christian Science Monitor wrote in August.

The latest surveys don’t look good for Arpaio. One ArizonaRepublic/Morrison/Cronkite News poll conducted Oct. 10-15, after federal prosecutors announced that they would file the charges, found the sheriff trailing Democratic challenger Paul Penzone by almost fifteen percentage points.

Deputies in the sheriff’s office are accused of continuing racially discriminatory traffic stops, at Arpaio’s behest, for as long as 18 months after an order to halt the practice. Arpaio has acknowledged violating the terms of the order but argues that his disobedience was unintentional. Prosecutors say they will seek a jail term of up to six months for the sheriff.

Mr. Penzone, his opponent in the elections, told the Associated Press that Arpaio has no one to blame but himself for the charge.

"It's another example of the sheriff putting his own personal objectives ahead of the best interest of the community at our expense," he said.

Arpaio's stiffening electoral odds come as the sheriff has enjoyed a bit of extra national limelight with the ascent of Republican presidential candidate Donald Trump, for whom he has stumped. And in 2012, volunteers at his office breathed life in the “birther” conspiracy movement – one key to Mr. Trump’s own rise – when they claimed they had found definitive proof that President Obama’s birth certificate was a forgery.