MARIETTA, Ga. — A Georgia man has been sentenced to 20 years in prison for beating his 2-year-old son and attacking a Cobb County police officer with a railroad spike.

A spokeswoman for the Cobb County district attorney’s office, Kim Isaza, tells The Atlanta Journal-Constitution 29-year-old Christian Hobby pleaded guilty Monday to charges including aggravated assault on a peace officer and child cruelty. Cpt. James Bullock tells WSB-TV he was trying to take Hobby into custody when he was hit in the face by a railroad spike. An arrest warrant says Hobby struck Bullock five times in the face and head.

Hobby also admitted to bruising his child’s thigh that same month and contacting a woman in violation of a temporary protective order.