(1) Subject to the provisions of this section and of section 28-1414, the use of force upon or toward another person is justifiable when the actor believes that such force is immediately necessary for the purpose of protecting himself against the use of unlawful force by such other person on the present occasion.
(2) The use of such force is not justifiable under this section to resist an arrest which the actor knows is being made by a peace officer, although the arrest is unlawful.
(3) The use of such force is not justifiable under this section to resist force used by the occupier or possessor of property or by another person on his behalf, where the actor knows that the person using the force is doing so under a claim of right to protect the property, except that this limitation shall not apply if:
(a) The actor is a public officer acting in the performance of his duties or a person lawfully assisting him therein or a person making or assisting in a lawful arrest;
(b) The actor has been unlawfully dispossessed of the property and is making a reentry or recapture justified by section 28-1411; or
(c) The actor believes that such force is necessary to protect himself against death or serious bodily harm.
(4) The use of deadly force shall not be justifiable under this section unless the actor believes that such force is necessary to protect himself against death, serious bodily harm, kidnapping or sexual intercourse compelled by force or threat, nor is it justifiable if:
(a) The actor, with the purpose of causing death or serious bodily harm, provoked the use of force against himself in the same encounter; or
(b) The actor knows that he can avoid the necessity of using such force with complete safety by retreating or by surrendering possession of a thing to a person asserting a claim of right thereto or by complying with a demand that he abstain from any action which he has no duty to take, except that:
(i) The actor shall not be obliged to retreat from his dwelling or place of work, unless he was the initial aggressor or is assailed in his place of work by another person whose place of work the actor knows it to be; and
(ii) A public officer justified in using force in the performance of his duties or a person justified in using force in his assistance or a person justified in using force in making an arrest or preventing an escape shall not be obliged to desist from efforts to perform such duty, effect such arrest or prevent such escape because of resistance or threatened resistance by or on behalf of the person against whom such action is directed.
(5) Except as required by subsections (3) and (4) of this section, a person employing protective force may estimate the necessity thereof under the circumstances as he believes them to be when the force is used, without retreating, surrendering possession, doing any other act which he has no legal duty to do, or abstaining from any lawful action.
(6) The justification afforded by this section extends to the use of confinement as protective force only if the actor takes all reasonable measures to terminate the confinement as soon as he knows that he safely can do so, unless the person confined has been arrested on a charge of crime.