It is a defence to a criminal act if, at the time which the act was committed, the person was suffering from a mental impairment that had the effect that they either did not know the nature and quality of what they were doing or they did not know that their conduct was wrong. Essentially that the accused could not reasonably conceive that their conduct, as perceived by reasonable people, was wrong.
Mental impairment defences are controlled by section 20 of the Crimes (Mental Impairment and Unfitness to be Tried) Act 1997. It is for people who were suffering from a mental impairment at the time they committed the criminal act. The issue of mental impairment may be brought up at any stage during a trial by defence or prosecution.
The basic principle is that an accused is considered not to be suffering from a mental impairment until the opposite is proven. Whichever side raises the question of mental impairment must, in effect, rebut the presumption. It is a defence which must be proved on the balance of probabilities.