Maricopa County Sheriff Joe Arpaio, Known for the hard line he takes against illegal immigration, on Thursday admitted to, and apologized for, hiring a private investigator to look into the wife of a U.S. District Court judge who is overseeing contempt of court proceedings against him.

Arpaio, serving his sixth term as the top law enforcement officer in Arizona’s largest county, made the confession under direct questioning from Judge G. Murray Snow. Arpaio said he had received an e-mail from a source who claimed to have met Snow’s wife at a restaurant, where she told the source her husband “wanted to do everything to make sure I’m not elected,” the Arizona Republic reported.

Arpaio said he then hired a private investigator to look into the incident. He said the investigator confirmed that Snow’s wife was, in fact, in the restaurant.

Known not only for his position on but for stunts like forcing prisoners to wear pink underwear, Arpaio is on trial for violating Snow’s orders in an earlier racial profiling suit. Snow ordered Arpaio’s office to stop detaining people based on suspicions of being in the country illegally back in December 2011. Arpaio and his attorneys have repeatedly said that while his office did violate some of Snow’s orders, there were no willful violations.

He took the stand Wednesday and Thursday in his own defense, after a Maricopa County sergeant testified Arpaio had personally issued orders to continue enforcing federal immigration laws, even after Snow ordered a halt to those practices.

“This court order slipped through the cracks,” Arpaio said Thursday in court, The Republic reported.

Attorneys for the American Civil Liberties Union, which brought the case against Arpaio, have tried to show that Arpaio knew he was violating the order.