PHOENIX (AP) — A law enforcement officer provided a rare glimpse into the inner workings of Sheriff Joe Arpaio’s office on Tuesday during a contempt-of-court hearing in which the officer said the sheriff was to blame for ignoring a 2011 order that barred his signature immigration patrols.

Sgt. Brett Palmer, once a supervisor on Arpaio’s immigrant smuggling squad, described a tense exchange with the sheriff about the court order and said the sheriff’s office was driven by a need to garner publicity for the sheriff.

Palmer described what he said was the prevailing ethic at Arpaio’s office: “That it’s our duty to make the sheriff look good to the media and the public,” he said.

The four-day civil contempt hearing got underway in a packed courtroom that included immigrant rights advocates and critics who have had political tangles with Arpaio in the past. The hearing marks the boldest attempt to hold the normally defiant sheriff personally responsible for his actions.

Arpaio has acknowledged disobeying a judge’s pretrial order in a racial profiling case that barred his immigration patrols. Rank-and-file officers weren’t told about the injunction, leaving them to violate the order for about 18 months.

The sheriff also has accepted responsibility for his agency’s failure to turn over traffic-stop videos in the profiling case and bungling a plan to gather such recordings from officers once some videos were discovered.

Arpaio could face fines if he’s found to be in civil contempt. The judge has warned that Arpaio will have to pay any fines out of his own pocket and can’t stick taxpayers with the tab.

Palmer said he drew up training materials that would help officers comply with the 2011 order, but those lessons were never carried out. “It was contrary to the goals and objectives of the sheriff,” he said.

Arpaio looked on without expression as Palmer criticized him. It’s unclear when Arpaio will be called to testify.

Palmer said the sheriff, about a month after the 2011 order was issued, became upset when learning that federal immigration authorities had refused to accept immigrants detained by the sheriff’s office because they were in a suspected smuggling vehicle.

Without a state criminal violation to hold the immigrants, the sheriff’s office was no longer able to detain them. Palmer planned to bring the immigrants to another federal immigration agency, but he was ordered to first callArpaio, who ordered him not to release them.

“The sheriff took a very authoritative stance,” Palmer said, noting that the sheriff raised his voice during the call but eventually backed down.

Under questioning by an Arpaio attorney, Palmer acknowledged that he has since been passed over for two promotions.

Palmer said the sheriff wanted to change the name of his signature squad from the human smuggling unit to the human smuggling division because using the word division would bring more media attention. He said he was asked to provide input on the sheriff’s ill-fated idea to set up roadblocks aimed at targeting immigrants in the country illegally.

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

