Insanity is a mental illness of such a severe nature that a person
cannot distinguish fantasy from reality, cannot manage his/her own affairs,
or is subject to uncontrollable impulsive behavior. In criminal cases,
a plea of "not guilty by reason of insanity" will require a trial on the
issue of the defendant's insanity (or sanity) at the time the crime was
committed.

In this context, "not guilty" does not mean the person did not commit
the criminal act for which he or she is charged. It means that when the
person committed the crime, he or she could not tell right from wrong or
could not control his or her behavior because of severe mental defect or
illness. Such a person, the law holds, should not be held criminally responsible
for his or her behavior. The legal test for insanity varies from state
to state.

Frequently, a person whose mental illness is not an issue in dispute will still be held responsible despite a mental illness. Such a ruling is known as either a Guilty but Mentally Ill (GBMI) or a Guilty but Insane verdict. It is sometimes involved in cases of crimes committed while a person was intoxicated at the time the crime was committed.

What happens to a defendant after a judge or jury returns a finding
of insanity depends on the crime committed, and on the state in which the
trial takes place. Usually, those found "not guilty by reason of insanity
are institutionalized in a special hospital for severely mentally ill persons
who have committed crimes. After a period of time, the person may request
a hearing to determine if he or she is no longer a danger to self or others
or no longer mentally ill, and is therefore eligible to be released.