Lisa Allen, chief spokeswoman for the media-savvy lawman for nearly 23 years, said Arpaio’s earlier career as a federal drug agent taught him respect for the orders of federal courts. “He was a federal guy,” Allen said. “He knew what to do if there was a court order.”

Allen testified on the second day of Arpaio’s trial on a misdemeanor contempt-of-court charge for continuing the traffic patrols 17 months after a judge in a racial profiling lawsuit ordered them stopped.

Arpaio, the former six-term sheriff of metro Phoenix, has acknowledged prolonging the patrols, but said his disobedience wasn’t intentional.

Prosecutors must prove that Arpaio purposefully violated the order to win a conviction. They cited a news release that came after the 2011 order in which Arpaio said he’d continue to enforce illegal immigration laws. They also read an excerpt from a March 2012 TV interview in which Arpaio said his officers were still detaining immigrants who were in the country illegally.

The 85-year-old Arpaio would face up to six months in jail if convicted, though lawyers who have followed the case doubt he would ever be incarcerated.

Earlier Tuesday, an attorney who defended Arpaio for nearly six years in the profiling case testified that his client’s growing resistance to court orders led him to quit as the lawman’s attorney. Tim Casey cited attorney-client privilege in declining to provide specific details.

“Until there was criminal contempt, there was never an issue with the sheriff and I about me doing my job,” Casey said.

Prosecutors then showed a video clip from a 2014 documentary about Arpaio in which Allen said the sheriff was addicted to the media and had “a stream of narcissism to him.” She also said in the film that Arpaio’s media attention gives him power.

Allen said Tuesday she urged Arpaio to scale back on the number of news releases he made about his immigration efforts, saying reporters were being bombarded with information. She said she usually lost those arguments.