Sometimes, an act or omission by a person that would otherwise amount to a criminal offence is excused at law because the accused acted out of necessity.
The Elements of the Defence of Necessity
It has been observed that the defence of necessity describes a scenario in which an accused is compelled to choose between the "lesser of two evils" or the "greater good" (R v. Loughnan  VR 443.
At common law the elements are:
The criminal act or acts must have been done only to avoid certain consequences that would have inflicted irreparable evil upon the accused or others who the accused was bound to protect.
The accused must have honestly believed on reasonable grounds that he or she was placed in a situation or imminent peril.
The acts done to avoid the imminent peril must not have been out of proportion to the peril to be avoided.
In R v. Rogers (1986) 86 A Crim R 542, the Court observed when considering the application of a necessity defence, that "the accused must have been afforded no reasonable opportunity for an alternative course of action which did not involve a breach of the law".
The concepts of imminent harm and proportionality are also germane to the defence of self-defence.
Application of Defence at Law
The defence of necessity may be utilised in offences which would otherwise attract strict liability, such as (and every case turns on its own facts) dangerous driving due to excessive speed.
Otherwise, the defence may have more broader application to alleged criminal offending.
As with self-defence, case law has established that the elements set out above, are not applied in a mechanical manner, and whether the acts undertaken by an accused were reasonable, or proportionate is one of several factors to weigh in the balance as to whether necessity may have application (R v Rogers (1986) 86 A Crim R 542).
The availability of any defence including necessity, will turn upon the particular facts in play. An experienced criminal defence lawyer will assess and provide advice to a client on the application of this defence to an allegation of criminal offending.
Other useful links:
Judicial College of Victoria. Refer to Criminal Charge Book.