An officer was attacked when he was detained by a suspect of being a victim in domestic abuse.