Maricopa County Sheriff Joe Arpaio took to the witness stand in his contempt of court hearing Thursday, and revealed that he conducted a secret investigation into federal Judge G. Murray Snow and his family.

Arpaio dropped the bombshell as Judge Snow questioned him in a Phoenix courtroom.

Nearly two years ago, the judge ordered Sheriff Arpaio and his officers to stop racially motivated immigration patrols throughout the Phoenix metro area. This week’s civil hearing is to determine whether or not Arpaio violated that order.

Judge Snow took a turn asking Arpaio questions after lawyers did.

“Are you aware that I’ve been investigated by anyone?” the judge asked.

Arpaio stumbled for an answer then admitted his lawyer Tim Casey had hired someone to investigate Snow’s wife after she allegedly said she didn’t want to see the sheriff re-elected.

Arpaio also testified that he and Maricopa County Sheriff’s Office member Mike Zullo conducted a secret investigation into a second matter “possibly” related to the judge himself.

Snow ordered Arpaio turn over all documents related to the snooping – with the help of a court monitor so that things don’t get lost, “inadvertently or otherwise.”

The third day of testimony began with ACLU lawyer Stanley Young playing previous interviews of Sheriff Arpaio – which he says show the sheriff willingly and knowingly violated the 2011 court order.

Arpaio responded to the videos with remorse, saying words spoken through the media are sometimes “taken out of context.”

“I’ve been a top federal official for 22 years. I have a deep respect for … the federal courts and federal judges. I didn’t know all the facts of this court order. And it really hurts me after 55 years to be in this position. I want to apologize to the judge. I should’ve known more about that court order. It fell through the cracks,” Arpaio said on the stand.

But Young says the sheriff “did not change and did not plan to change anything about what [he was] doing.”

The civil hearing will continue until the end of the week.

It was not immediately clear what consequences Arpaio could face over the private investigator. Federal law prohibits anyone from trying to attempt to intimidate or inappropriately influence a federal judge.

Paul Charlton, the former top federal prosecutor for Arizona and an Arpaio critic, told the Associated Press that a probe needs to be conducted to determine if the investigation of the judge’s wife broke the law.

“What we heard today is deserving of scrutiny by federal law enforcement because it is inappropriate — if not unlawful — to investigate a sitting district court judge,” said Charlton, who isn’t involved in the contempt case.