.

At the request of a congressional candidate’s campaign, the San Joaquin County sheriff’s office doctored the image of a man arrested in a pedophilia sting — a move the sheriff now says was a mistake.

David Alanis, one of 24 alleged sex offenders caught in the bust, was wearing a shirt with the logo of Ted Howze, who is running for the seat held by Rep. Josh Harder.

The candidate’s staffers, who say Alanis “absolutely isn’t affiliated with our campaign,” called the sheriff to complain about the photo.

“They said, “Hey, look, we don’t know this person. We don’t know why they’re wearing our shirts, we can’t control that. We’d appreciate it if you didn’t associate our brand name with that person,'” Sheriff Pat Withrow told TV station FOX40.

The sheriff’s staff obliged, whiting out the logo.

And that probably would have gone unnoticed, but sharp-eyed observers had seen the undoctored photo on a Facebook post of the Lathrop Police Department, which was also involved in the sting. The editing raised questions of whether the sheriff had made a special exception for Howze.

Withrow, who has been in the post less than a year, said: “We’re new to this and when we make mistakes we’re going to admit them. There was no political motivation. We got to protect everybody. Our job is to stay out of that stuff as much as possible.”

The office’s new policy: blur all logos on arrest pictures.

“I hope we don’t lost sight of the fact that we took a lot of child molesters off the street that day,” Withrow told FOX40.

In the underage-decoy sting at a Lathrop motel in April, Alanis, 36, was one of 18 people arrested on charges including contacting a minor with intent for sex, arranging a meet with a minor for the purposes of sex, and lewd or lascivious acts with a child under the age of 14.