PHOENIX (AP) — There were no TV cameras, no scrum of reporters, no protesters — and there was no swagger inside the courtroom when the typically brash Arizona Sheriff Joe Arpaio took the stand to face critics who say he and his deputies racially profile Hispanics.

Under questioning from lawyers representing a group Latinos who are suing him and his department, Arpaio spoke in a hush, offering that he was suffering from the flu.

He was asked: Why did you call illegal immigrants “dirty?”

The Maricopa County sheriff responded quietly, clearing his throat often, and saying the statement was taken out of context. He added that if a person were to cross the U.S.-Mexico border on foot over four days in the desert that person “could be dirty.”

“That’s the context on how I used that word,” he said.

The case represents the first time the sheriff’s office has been accused of systematic racial profiling and will serve as a precursor to a similar yet broader civil rights lawsuit filed against Arpaio by the U.S. Justice Department.

Arpaio has long denied racial profiling allegations and said Tuesday, “We don’t arrest people because of the color of their skin.”

Letters in the sheriff’s immigration file took center stage during his more than five hours of testimony — as did his previous statements, which critics say show prejudiced thinking on his part.

Lawyers in court asked Arpaio: What about your statement on a national TV news show saying you considered a 2007 comparison between your department and the Ku Klux Klan “an honor”?

Arpaio responded that he doesn’t consider the comparison an honor, adding that he has no use for the KKK.

The plaintiffs’ attorneys also turned to Arpaio’s famous practice of putting county jail inmates in pink underwear, using statements he made during a 2009 speech to an anti-illegal immigration group in Houston.

“I always have an official reason so I can win the lawsuits,” Arpaio said, after stating the pink shorts are less likely to be smuggled out of jail and sold on the black market.

“And then I have my reasons,” he went on. “And my reason is they hate pink. They do. They may like it in California, but they don’t like it in Arizona.”

He was asked whether he says one thing in court and does another when he leaves.

“This is in humor,” Arpaio said. “I make sure we do things properly in case I get sued.”

The group of Latinos who say they have been discriminated against say Arpaio launched some immigration sweeps based on emails and letters that don’t allege crimes, but complain only that “dark-skinned people” are congregating in a given area or speaking Spanish.

During the sweeps, sheriff’s deputies flood an area of a city — in some cases, heavily Latino areas — over several days to seek out traffic violators and arrest other offenders.

Illegal immigrants accounted for 57 percent of the 1,500 people arrested in the 20 sweeps conducted by Arpaio’s office since January 2008, according to figures provided by the sheriff’s department, which hasn’t conducted any such patrols since October.

Arpaio was asked whether a white person was ever arrested on an immigration violation during the first two years of such sweeps, to which he replied, “I can’t recall.”

The plaintiffs aren’t seeking money in the suit. They are seeking a declaration that Arpaio’s office racially profiles Latinos and an order requiring policy changes.

If Arpaio loses the case, he won’t face jail time or fines. If he wins, it would be likely to severely undercut the government’s case against him.

The plaintiffs say deputies conducting Arpaio’s sweeps pulled over Hispanics without probable cause, making the stops only to inquire about the immigration status of the people in the vehicles.

The sheriff maintained that people are stopped only if authorities have probable cause to believe they have committed crimes and that deputies later find many of the people stopped are illegal immigrants.

Plaintiff’s lawyers say Arpaio endorsed calls for racial profiling with the sweeps by passing along the ambiguous and racially-charged complaint letters to aides who planned his immigration enforcement efforts and carried out at least three patrols after receiving the letters.

They also point out that Arpaio wrote thank-you notes to some who sent complaints.

Arpaio’s attorneys denied that the letters and emails prompted the sheriff to launch the patrols with a discriminatory motive. His lawyers called the complaints racially insensitive and said aides to the sheriff — not Arpaio himself — decided where to conduct the patrols. They also said there was nothing wrong with the thank-you notes.

“He sends thank-you letters because he is an elected official,” Tim Casey, the lawyer leading Arpaio’s defense, said during opening arguments.

In an August 2008 letter, a woman wrote about a Sun City restaurant: “From the staff at the register to the staff back in the kitchen area, all I heard was Spanish — except when they haltingly spoke to a customer.” The letter ended with a suggestion that the sheriff investigate.

Arpaio made a handwritten note in the margins saying, “letter thank you for info will look into it” and that the complaint should be sent to aide Brian Sands, who selects locations for sweeps, with a notation saying “for our operation.” The sheriff’s office launched a sweep two weeks later in Sun City.

Arpaio said in response to a question about the letter Tuesday that speaking Spanish is not a crime and that he sent the note to Sands for “him for whatever he wants to do with it.”

Arpaio also said he generally passed along the letters that called for immigration enforcement in a particular area to his subordinates, but didn’t do the planning for the sweeps.

“I just send this info to my subordinates so they could ask for it. I don’t agree with every letter I receive,” Arpaio said.