When a defendant wants to argue that they are not guilty despite not contesting that they performed the alleged act, they often argue that they were mistaken not as to the law, but as to the facts of the case. A factual mistake is much more likely to be a worthwhile defense in many cases than a legal mistake.
For example, say you were charged for trespassing on private property. To argue a mistake of law would be to say that you did not know trespassing was illegal, which would not be a valid defense. To argue mistake of fact, you could say that you reasonably thought you were allowed to be where you were, and therefore was not aware that you were actually trespassing. What would be considered ‘reasonable’ in this case is not always clear, and often comes down to what the jury may decide given the evidence presented.
While most mistake-of-fact cases rely on a sense of reasonableness, there are crimes where it cannot be used as a defense no matter how seemingly reasonable the defendant’s position is. One notable example is statutory rape charges in North Carolina and many other states, where a defendant being mistaken as to the fact that their sexual partner was a minor cannot be used as a defense, no matter what.