According to California Law, an individual can be convicted of resisting a peace officer if they attempt “by means of any threat or violence, to deter or prevent an executive officer from performing any duty imposed upon such officer by law, or who knowingly resists, by the use of force or violence, such officer, in the performance of his duty." (Pen. Code § 69.)
The District Attorney must prove beyond a reasonable doubt that the accused used force or violence to resist an executive officer, that when the defendant acted, the officer was performing his or her lawful duty, and when the individual acted, he or she knew the executive officer was performing his or her duty. (Calcrim 2652.)
An “executive officer" is a government official who may use his or her own discretion in performing his or her job. A peace officer is not lawfully performing his or her duties if he or she is unlawfully arresting or detaining someone, or using unreasonable or excessive force in his or her duties. (Calcrim 2652.) Such actions on the part of the peace officer provide a defense to Penal Code section 69.