PHOENIX (AP) — Former Sheriff Joe Arpaio intentionally ignored a court order to stop traffic patrols that targeted immigrants to keep his name in the news during a tough re-election year, a federal prosecutor argued Thursday at the end of Arpaio’s criminal trial.

The former six-term sheriff of metro Phoenix, whose crackdowns on illegal immigration made him a national name, knew that a judge barred the patrols but kept them up for nearly a year and a half for political reasons, prosecutor John Keller said in his closing argument.

Keller said Arpaio cast himself as an anti-government figure and used the patrols to help raise money during his 2012 campaign.

“He wanted to raise money and win re-election, and it worked,” Keller said.

Arpaio is charged with misdemeanor contempt of court for violating a 2011 order to stop the patrols that a judge later determined racially profiled Latinos. The 85-year-old retired lawman would face up to six months in jail if convicted, though attorneys who have followed the case doubt that someone his age would be incarcerated.

Arpaio’s tactics over 24 years in office drew fierce opponents as well as enthusiastic supporters nationwide who championed what they considered a tough-on-crime approach, including forcing inmates to wear pink underwear and housing them in tents outside in the desert heat.

The lawman has acknowledged prolonging the immigration patrols but insists it was not intentional. His attorney will present closing arguments later in the day.

Prosecutors cited Arpaio’s use of TV interviews and news releases to boost his popularity as they try to get a conviction from U.S. District Judge Susan Bolton. Keller played videos of TV news interviews in which the sheriff promoted his immigration enforcement efforts.

A clip from a Fox News interview six months after the order showed Arpaio saying federal authorities were taking custody of immigrants detained by his deputies, even though they had not been suspected of state crimes.

“ICE (Immigration and Customs Enforcement) has been taking them off our hands when we have no state charges,” Arpaio said in the March 2012 interview.

Keller said Arpaio’s motive was to collect campaign contributions and used the sheriff’s words to back up his argument.

“They don’t give you money if they don’t believe in you,” Arpaio said in a video clip recorded six months after the order.

The prosecutor also pointed out news releases in which Arpaio’s office acknowledged that deputies were turning over immigrants not accused of state crimes to federal authorities, which wasn’t allowed under the court order. Keller said Arpaio bragged to news reporters that he was still detaining immigrants.

Arpaio carried out the sort of local immigration enforcement that President Donald Trump has advocated. To build his highly touted deportation force, Trump is reviving a long-standing program that deputizes local officers to enforce federal immigration law.

Arpaio’s immigration powers were eventually stripped away by the courts and federal government.

The sheriff has faulted a former attorney defending him in a racial profiling lawsuit for not properly explaining the importance of the court order.

But prosecutors said attorney Tim Casey told the sheriff that his officers could not detain immigrants who had not been suspected of a state crime. Casey testified that he told Arpaio that his officers would either have to arrest or release immigrants in such situations and could not bring them to federal immigration authorities.

Arpaio’s defense also focused on what it calls 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 legal woes are believed to have contributed heavily to his crushing defeat in November to retired Phoenix Police Sgt. Paul Penzone.
___

Follow Jacques Billeaud at twitter.com/jacquesbilleaud. His work can be found at https://www.apnews.com/search/jacques%20billeaud .