Controversial Arizona lawman Joe Arpaio admitted on Thursday to civil contempt over his office’s violation of court orders in a racial profiling case, apologized to the judge and insisted it was not intentional.

The 82-year-old, who bills himself as “America’s toughest sheriff” and is seeking re-election for a seventh term, was testifying for a second day in federal Court in Phoenix at a hearing to decide if he and four others will face punishment.

Arpaio has repeatedly said he left it to subordinates to ensure the Maricopa County Sheriff’s Office was complying with the judge’s 2011 orders, which were meant to end illegal immigration sweeps being conducted by his deputies.

“I have a deep respect for the courts,” he said.

“It really hurts me after 55 years to be in this position. I want to apologize to the judge. I should have known more about these court orders that slipped through the cracks.”

The immigration sweeps continued for 18 months after the judge’s orders were issued.

In a separate development that emerged during direct questioning by U.S. Judge Murray Snow, Arpaio said he was connected with two investigations involving the judge and the judge’s wife.

In the first, Arpaio told Snow, he had been tipped off that the U.S. Department of Justice was bugging telephones belonging to people including himself, his lawyers, Snow, and other judges.

Arpaio said he sent detectives from his office to meet with a confidential informant in Washington state to investigate further, but that it was concluded that the information could not be confirmed.

In the second, Arpaio said, one of his attorneys had hired a private detective to check out a tip Arpaio said he received that Snow’s wife was overheard saying in a restaurant she would do everything she could to stop Arpaio being re-elected.

Arpaio said the private detective investigated and reported speaking to witnesses who said they also heard the comments.

Snow ordered Arpaio and his office to preserve all records of both investigations.

“I want all records that in any way relate,” Snow said.

He has ordered that Arpaio appear in U.S. District Court along with three aides and a former aide. They face possible punishments including fines, restitution for individuals harmed and increased agency oversight.

Arpaio ended his testimony on Thursday, the third of four days of hearings. Another four days of hearings are scheduled in June.