Can I disobey a police order if I have reason to believe that to obey would put my life in imminent danger?
<p>Suppose I am detained by a police officer and ordered to remain in the exact spot. However, the officer doesn't notice that I am three seconds away from potentially being impaled by someone or something. Or, the officer knows and still refuses to allow me to move. Am I legally free to ignore the order to stay?</p>

<p>California law has a general defense of necessity.  It appears that it's not in statute, but rather comes from common law.  It's described in what appears to be the official jury instructions at <a href="https://www.justia.com/criminal/docs/calcrim/3400/3403/" rel="nofollow noreferrer">CALCRIM 3403</a>.  </p>

<blockquote>
  <p>The defendant is not guilty of (insert crime[s]) if (he/she)
  acted because of legal necessity.</p>
  
  <p>In order to establish this defense, the defendant must prove that:</p>
  
  <ol>
  <li><p>(He/She) acted in an emergency to prevent a signiﬁcant bodily
  harm or evil to (himself/herself/ [or] someone else);</p></li>
  <li><p>(He/She) had no adequate legal alternative;</p></li>
  <li><p>The defendant’s acts did not create a greater danger than the
  one avoided;</p></li>
  <li><p>When the defendant acted, (he/she) actually believed that the act
  was necessary to prevent the threatened harm or evil;</p></li>
  <li><p>A reasonable person would also have believed that the act was
  necessary under the circumstances;</p></li>
  </ol>
  
  <p>AND</p>
  
  <ol start="6">
  <li>The defendant did not substantially contribute to the emergency.</li>
  </ol>
  
  <p>The defendant has the burden of proving this defense by a
  preponderance of the evidence. This is a different standard of proof
  than proof beyond a reasonable doubt. To meet the burden of proof by
  a preponderance of the evidence, the defendant must prove that it is
  more likely than not that each of the six listed items is true.</p>
</blockquote>

<p>It seems like all six requirements would apply in your hypothetical case, so if you could prove them, you'd be off the hook for a violation of Cal. Penal 148(a)(1) as cited by user6726.</p>

criminal-law california