Insanity in English law is a defence to criminal charges based on the idea that the defendant was unable to understand what he was doing, or, that he was unable to understand that what he was doing was wrong.
The defence comes in two forms; where the defendant claims he was insane at the time of the crime, and where the defendant asserts he is insane at the time of trial. In the first situation, the defendant must show that he was either suffering from a disease which damaged the functioning of the mind and led to a defect of reason that prevented him from understanding what he was doing, or that he could not tell that what he was doing was wrong. In the second situation, the test is whether or not the defendant can differentiate between "guilty" and "not guilty" verdicts, instruct counsel and recognise the charges he is facing. If successful, he is likely to be detained under the Criminal Procedure (Insanity) Act 1964, although judges have a wide discretion as to what to do.
Use of insanity as a concept dates from 1324, and its criminal application was used until the late 16th century in an almost identical way. The defence, if successful, either allowed the defendant to return home or led to him being incarcerated until he was granted a royal pardon; after 1542, a defendant who became insane prior to the trial could not be tried for any crime, up to and including high treason. During the 18th century the test to determine insanity became extremely narrow, with defendants required to prove that they could not distinguish between good and evil and that they suffered from a mental disease which made them incapable of understanding the consequences of their actions. The current wording comes from the M'Naghten Rules, based on the trial of Daniel M'Naghten in 1843. (Full article...)