BAKERSFIELD, Calif. (KGET) — When William Davis left home for work — or to buy marijuana — he zip-tied his young son to prevent him from going outside.

The boy told investigators he estimated his father had tied him up 100 times. Sometimes the binds made him bleed.

After Davis’ arrest in June of last year, detectives showed him photos of his then-7-year-old son’s injuries. Davis smirked, according to court documents.

On Tuesday, Davis, 33, was sentenced to six years in prison after pleading no contest to willful cruelty to a child and battery with serious bodily injury. Other charges, including torture, were dismissed under the plea agreement.

The events leading to Davis’ arrest began June 23 after neighbors reported seeing a bound boy hopping outside Davis’ apartment in the 100 block of Beardsley Avenue. Deputies found the boy’s ankles and wrists secured with zip ties. They freed the child and asked him what happened.

“The juvenile victim stated Davis would zip tie them before he went to work and before he went to purchase marijuana,” a detective wrote in court documents.

There were scars on the child’s thighs. The boy told detectives they were the result of Davis hitting him with an electrical cord.

In the house, investigators found a glass jar on a stove containing marijuana and drug paraphernalia, the documents said. They also located a large amount of pornographic material, including more than 200 photos on the outside of a refrigerator and several boxes filled with DVDs.

Davis wasn’t home at the time, but later voluntarily went to the sheriff’s office to be interviewed. He asked a few questions and then detectives showed him photos of his son’s injuries.

“While Davis was looking at the photographs, I noticed he had a smirk or smile on his face for a brief period,” an investigator wrote.

A judge approved a warrant for Davis’ arrest and he was held without bail. He pleaded no contest last month.